620b83832b
* Implement manually invokable jobs through the invokeTrigger Also implemented a job run notification system, that will POST details of a run on completion. This combines with the task callbackUrl system to implement the invokeAndWait * Document the invoke trigger * batch invoke and wait * background fetch timeouts * Use @whatwg-node/fetch instead of the polyfilled fetch * Fix some outdated dependencies in webapp * Improved subtask error propogation messages * Document the OpenAI changes and the batch invoke stuff * Fix dequeuing jobs * Don’t retry the OpenAI completion background task * Added OpenAI changesets * Use the new ResumeTaskService in ProcessCallbackTimeout as well
7 lines
239 B
TypeScript
7 lines
239 B
TypeScript
export function singleton<T>(name: string, getValue: () => T): T {
|
|
const thusly = globalThis as any;
|
|
thusly.__trigger_singletons ??= {};
|
|
thusly.__trigger_singletons[name] ??= getValue();
|
|
return thusly.__trigger_singletons[name];
|
|
}
|