Files
cgalo5758 88db730fcc Add dual licensing and SPDX headers
Introduce a commercial license option alongside AGPL-3.0-only, require a
CLA for contributors, and document the terms in COMMERCIAL.md and
NOTICE. Add a script to stamp SPDX headers on Go files and apply it
across the tree.
2026-09-06 02:29:42 -05:00

32 lines
1.3 KiB
Go

// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
// SPDX-FileCopyrightText: 2025-2026 Christian Galo
package maintenance
import (
"git.coopcloud.tech/wiki-cafe/member-console/internal/workflows/common"
"go.temporal.io/sdk/workflow"
)
// EnsureWebhookPartitionsWorkflow keeps core.webhook_events' monthly RANGE
// partitions provisioned ahead of need. It runs on a recurring schedule as
// the backstop to the console's own boot pass: the boot pass covers every
// deployment on every restart, Temporal-configured or not, but a deployment
// that runs for longer than the partition lookahead window without
// restarting needs this schedule to keep extending it (design.md D3,
// webhook-partition-maintenance spec, "Long-running deployment never
// exhausts partitions").
func EnsureWebhookPartitionsWorkflow(ctx workflow.Context) error {
logger := workflow.GetLogger(ctx)
ctx = workflow.WithActivityOptions(ctx, common.DefaultActivityOptions())
var activities *Activities
var out EnsureWebhookPartitionsOutput
if err := workflow.ExecuteActivity(ctx, activities.EnsureWebhookPartitionsActivity).Get(ctx, &out); err != nil {
logger.Error("EnsureWebhookPartitionsActivity failed", "error", err)
return err
}
logger.Info("EnsureWebhookPartitionsWorkflow completed", "monthsAhead", out.MonthsAhead)
return nil
}