mirror of
https://github.com/outline/outline.git
synced 2026-11-29 16:40:27 +03:00
refactor: Add jobId hook to BaseTask for deduplicating queued jobs (#13890)
* refactor: Add jobId hook to BaseTask for deduplicating queued jobs * fix: Drop jobId from APIImportTask, it re-schedules itself while active
This commit is contained in:
1 parent
ed4aaf274d
commit
bc992fb22a
15 files changed
+71
-17
No files matched your search
@@ -8,6 +8,13 @@ type Props = {
|
||||
};
|
||||
|
||||
export default class GitHubWebhookTask extends BaseTask<Props> {
|
||||
protected jobId({ headers }: Props) {
|
||||
const deliveryId = headers["x-github-delivery"];
|
||||
return typeof deliveryId === "string"
|
||||
? `github-webhook:${deliveryId}`
|
||||
: undefined;
|
||||
}
|
||||
|
||||
public async perform({ headers, payload }: Props): Promise<void> {
|
||||
const plugins = PluginManager.getHooks(Hook.IssueProvider);
|
||||
const plugin = plugins.find(
|
||||
|
||||
Reference in new issue
Block a user