fix api export and test timeouts

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-10-27 22:49:23 +02:00
parent 26cf7f631d
commit b5c106ac4c
4 changed files with 11 additions and 3 deletions
+1 -3
View File
@@ -24,9 +24,7 @@ export interface TaskDefinition {
timeout: Duration;
}
// Warning: (ae-missing-release-tag) "TaskFunction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export type TaskFunction =
| ((abortSignal: AbortSignal_2) => void | Promise<void>)
| (() => void | Promise<void>);
@@ -56,6 +56,7 @@ describe('PluginTaskManagerImpl', () => {
expect(fn).toBeCalled();
});
},
60_000,
);
});
});
@@ -56,5 +56,6 @@ describe('TaskManager', () => {
expect(fn).toBeCalled();
});
},
60_000,
);
});
@@ -18,6 +18,14 @@ import { Duration } from 'luxon';
import { AbortSignal } from 'node-abort-controller';
import { z } from 'zod';
/**
* A function that can be called as a scheduled task.
*
* It may optionally accept an abort signal argument. When the signal triggers,
* processing should abort and return as quickly as possible.
*
* @public
*/
export type TaskFunction =
| ((abortSignal: AbortSignal) => void | Promise<void>)
| (() => void | Promise<void>);