mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-01 14:46:36 +08:00
fix(task): execute dispatched jobs and persist run records
Asynq func handlers now go through ProcessTask so admin execution rows leave pending. The in-process worker resolves admin type identifiers and writes the same w_task_executions table. Remove the no-op admin system_cleanup that shadowed the upload handler.
This commit is contained in:
@@ -276,10 +276,17 @@ func (t *TaskRegistry) Tasks() []TaskDefinition {
|
||||
return res
|
||||
}
|
||||
|
||||
// Get retrieves a task definition by its pattern.
|
||||
// Get retrieves a task definition by its pattern or admin type identifier.
|
||||
func (t *TaskRegistry) Get(pattern string) (TaskDefinition, bool) {
|
||||
t.mu.RLock()
|
||||
defer t.mu.RUnlock()
|
||||
td, ok := t.lookup[pattern]
|
||||
return td, ok
|
||||
if td, ok := t.lookup[pattern]; ok {
|
||||
return td, true
|
||||
}
|
||||
for _, td := range t.tasks {
|
||||
if td.Type == pattern {
|
||||
return td, true
|
||||
}
|
||||
}
|
||||
return TaskDefinition{}, false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user