Rename root, api and sdk module paths (imports, go.mod, go_package, ldflags, build scripts, buf configs) and regenerate protobuf/gateway code with the project's pinned toolchain. Wire identifiers unchanged. api gets a local replace for sdk; root/api/sdk require v0.1.0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
36 lines
1.2 KiB
Go
36 lines
1.2 KiB
Go
// Copyright IBM Corp. 2020, 2026
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package plugin
|
|
|
|
import (
|
|
"context"
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/db"
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/errors"
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/kms"
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/scheduler"
|
|
plgpb "repo.anhonesthost.net/CyberCoveLLC/threshold/sdk/pbs/plugin"
|
|
)
|
|
|
|
// RegisterJobs registers plugin host related jobs with the provided scheduler.
|
|
func RegisterJobs(ctx context.Context, scheduler *scheduler.Scheduler, r db.Reader, w db.Writer, kms *kms.Kms, plgm map[string]plgpb.HostPluginServiceClient) error {
|
|
const op = "plugin.RegisterJobs"
|
|
setSyncJob, err := newSetSyncJob(ctx, r, w, kms, plgm)
|
|
if err != nil {
|
|
return errors.Wrap(ctx, err, op)
|
|
}
|
|
if err = scheduler.RegisterJob(ctx, setSyncJob); err != nil {
|
|
return errors.Wrap(ctx, err, op, errors.WithMsg("set sync job"))
|
|
}
|
|
orphanedHostCleanupJob, err := newOrphanedHostCleanupJob(ctx, r, w, kms)
|
|
if err != nil {
|
|
return errors.Wrap(ctx, err, op)
|
|
}
|
|
if err = scheduler.RegisterJob(ctx, orphanedHostCleanupJob); err != nil {
|
|
return errors.Wrap(ctx, err, op, errors.WithMsg("orphaned host cleanup job"))
|
|
}
|
|
|
|
return nil
|
|
}
|