@falcondev-oss/workflow 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +9 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConnectionOptions, Job, JobSchedulerTemplateOptions, JobsOptions, Queue, QueueEvents, QueueEventsOptions, QueueOptions, UnrecoverableError, WorkerOptions } from "bullmq";
|
|
2
2
|
import "@antfu/utils";
|
|
3
|
-
import IORedis from "ioredis";
|
|
3
|
+
import IORedis, { RedisOptions } from "ioredis";
|
|
4
4
|
import { Span } from "@opentelemetry/api";
|
|
5
5
|
import { SuperJSONResult } from "superjson";
|
|
6
6
|
import { Options } from "p-retry";
|
|
@@ -24,6 +24,7 @@ declare const Settings: {
|
|
|
24
24
|
defaultCronTimezone: string | undefined;
|
|
25
25
|
logger: WorkflowLogger | undefined;
|
|
26
26
|
};
|
|
27
|
+
declare function createRedisConnection(opts: RedisOptions): Promise<IORedis>;
|
|
27
28
|
//#endregion
|
|
28
29
|
//#region src/serializer.d.ts
|
|
29
30
|
type Serialized<T> = Tagged<SuperJSONResult, 'data', T>;
|
|
@@ -115,4 +116,4 @@ interface WorkflowRunContext<Input> {
|
|
|
115
116
|
span: Span;
|
|
116
117
|
}
|
|
117
118
|
//#endregion
|
|
118
|
-
export { Settings, Workflow, WorkflowInputError, WorkflowOptions, WorkflowRunContext };
|
|
119
|
+
export { Settings, Workflow, WorkflowInputError, WorkflowOptions, WorkflowRunContext, createRedisConnection };
|
package/dist/index.mjs
CHANGED
|
@@ -36,6 +36,14 @@ const defaultRedisConnection = createSingletonPromise(async () => {
|
|
|
36
36
|
await redis.connect();
|
|
37
37
|
return redis;
|
|
38
38
|
});
|
|
39
|
+
async function createRedisConnection(opts) {
|
|
40
|
+
const redis = new IORedis({
|
|
41
|
+
...defaultRedisOptions,
|
|
42
|
+
...opts
|
|
43
|
+
});
|
|
44
|
+
await redis.connect();
|
|
45
|
+
return redis;
|
|
46
|
+
}
|
|
39
47
|
|
|
40
48
|
//#endregion
|
|
41
49
|
//#region src/serializer.ts
|
|
@@ -330,4 +338,4 @@ var Workflow = class {
|
|
|
330
338
|
};
|
|
331
339
|
|
|
332
340
|
//#endregion
|
|
333
|
-
export { Settings, Workflow, WorkflowInputError };
|
|
341
|
+
export { Settings, Workflow, WorkflowInputError, createRedisConnection };
|
package/package.json
CHANGED