mirror of
https://github.com/outline/outline.git
synced 2025-04-13 15:43:14 +00:00
chore: Add sleep before Slack notification
This commit is contained in:
@ -11,6 +11,7 @@ import {
|
||||
Event,
|
||||
} from "@server/types";
|
||||
import fetch from "@server/utils/fetch";
|
||||
import { sleep } from "@server/utils/timers";
|
||||
import env from "../env";
|
||||
import presentMessageAttachment from "../presenters/messageAttachment";
|
||||
|
||||
@ -25,6 +26,8 @@ export default class SlackProcessor extends BaseProcessor {
|
||||
switch (event.name) {
|
||||
case "documents.publish":
|
||||
case "revisions.create":
|
||||
// wait a few seconds to give the document summary chance to be generated
|
||||
await sleep(5000);
|
||||
return this.documentUpdated(event);
|
||||
|
||||
case "integrations.create":
|
||||
|
@ -1,6 +1,6 @@
|
||||
import groupBy from "lodash/groupBy";
|
||||
import Logger from "@server/logging/Logger";
|
||||
import { timeout } from "./timers";
|
||||
import { sleep } from "./timers";
|
||||
|
||||
export enum ShutdownOrder {
|
||||
first = 0,
|
||||
@ -59,7 +59,7 @@ export default class ShutdownHelper {
|
||||
this.isShuttingDown = true;
|
||||
|
||||
// Start the shutdown timer
|
||||
void timeout(this.forceQuitTimeout).then(() => {
|
||||
void sleep(this.forceQuitTimeout).then(() => {
|
||||
Logger.info("lifecycle", "Force quitting");
|
||||
process.exit(1);
|
||||
});
|
||||
|
@ -3,6 +3,6 @@
|
||||
*
|
||||
* @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
|
||||
*/
|
||||
export function timeout(ms = 1) {
|
||||
export function sleep(ms = 1) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
Reference in New Issue
Block a user