mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-07 16:16:37 +08:00
feat(core): bind request services and implement registered tasks
Wire plugin services through Bind/InjectFrom and AppContext so HTTP and workers resolve dependencies after Apply. Register TaskHandler objects with persisted results, and implement send_email_code, mail:send, cleanup_inactive_users, and dispatch_bot_msg.
This commit is contained in:
@@ -83,7 +83,11 @@ func (p *Plugin) Start(ctx context.Context) error {
|
||||
p.scheduler = newInprocScheduler(p.coreCtx.Schedules(), p.coreCtx.Tasks(), taskSvc)
|
||||
}
|
||||
|
||||
return p.scheduler.Start(ctx)
|
||||
runCtx := ctx
|
||||
if p.coreCtx != nil {
|
||||
runCtx = core.WithAppContext(ctx, p.coreCtx.Root())
|
||||
}
|
||||
return p.scheduler.Start(runCtx)
|
||||
}
|
||||
|
||||
// Stop terminates the in-process cron scheduler.
|
||||
|
||||
Reference in New Issue
Block a user