mirror of
https://github.com/outline/outline.git
synced 2026-12-05 02:44:34 +03:00
* wip * Implementation complete * tidying * test * Address feedback * Remove duplicative retry logic from UpdateDocumentsPopularityScoreTask. Now that we're split across many runs this is not neccessary * Refactor to subclass, config to instance * Refactor BaseTask to named export * fix: Missing partition * tsc * Feedback
21 lines
512 B
TypeScript
21 lines
512 B
TypeScript
import { Hook, PluginManager } from "@server/utils/PluginManager";
|
|
import { requireDirectory } from "@server/utils/fs";
|
|
import { BaseTask } from "./base/BaseTask";
|
|
|
|
const tasks: Record<string, typeof BaseTask> = {};
|
|
|
|
requireDirectory<{ default: typeof BaseTask }>(__dirname).forEach(
|
|
([module, id]) => {
|
|
if (id === "index") {
|
|
return;
|
|
}
|
|
tasks[id] = module.default;
|
|
}
|
|
);
|
|
|
|
PluginManager.getHooks(Hook.Task).forEach((hook) => {
|
|
tasks[hook.value.name] = hook.value;
|
|
});
|
|
|
|
export default tasks;
|