diff --git a/apps/meteor/server/lib/onStartup.ts b/apps/meteor/server/lib/onStartup.ts deleted file mode 100644 index 2f449c449f4a..000000000000 --- a/apps/meteor/server/lib/onStartup.ts +++ /dev/null @@ -1,25 +0,0 @@ -type StartupCallback = () => Promise; - -const callbackList: StartupCallback[] = []; -let hasStarted = false; - -export const onStartup = (cb: StartupCallback): void => { - if (hasStarted) { - return Promise.await(cb()); - } - - callbackList.push(cb); -}; - -const runCallbacks = async (): Promise => { - for await (const cb of callbackList) { - await cb(); - } - - callbackList.splice(0, callbackList.length); -}; - -Meteor.startup(() => { - hasStarted = true; - Promise.await(runCallbacks()); -});