mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-06 01:39:04 +02:00
refactor: move API key cleanup job to actor (#1687)
This commit is contained in:
@@ -14,10 +14,6 @@ func registerScheduledJobs(ctx context.Context, db *gorm.DB, svc *services, sche
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to register DB cleanup jobs in scheduler: %w", err)
|
||||
}
|
||||
err = scheduler.RegisterApiKeyExpiryJob(ctx, svc.apiKeyModule, svc.appConfigService, svc.emailModule)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to register API key expiration jobs in scheduler: %w", err)
|
||||
}
|
||||
err = scheduler.RegisterScimJobs(ctx, svc.scimService)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to register SCIM scheduler job: %w", err)
|
||||
|
||||
@@ -170,8 +170,12 @@ func initServices(
|
||||
}
|
||||
|
||||
svc.apiKeyModule, err = apikey.New(ctx, apikey.Dependencies{
|
||||
DB: db,
|
||||
StaticApiKey: common.EnvConfig.StaticApiKey,
|
||||
DB: db,
|
||||
Actors: actors,
|
||||
StaticApiKey: common.EnvConfig.StaticApiKey,
|
||||
AppConfig: svc.appConfigService,
|
||||
EmailSender: svc.emailModule,
|
||||
CleanupDisabled: common.EnvConfig.AppEnv.IsTest(),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create API key module: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user