-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: all modules will be exported from the main entrypoint
- Loading branch information
Showing
32 changed files
with
141 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
examples/job-dependency.ts/child-job.ts → examples/job-dependency/child-job.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
examples/job-dependency.ts/parent-job.ts → examples/job-dependency/parent-job.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,28 @@ | ||
/** | ||
* @public | ||
*/ | ||
export type { default as BaseJobLock, JobLockId } from "./base"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { default as MongodbJobLock } from "./mongodb"; | ||
import type { Types } from "mongoose"; | ||
import type { Source } from ".."; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { default as RedisJobLock } from "./redis"; | ||
export type JobLockId<S extends Source> = S extends Source.Mongodb | ||
? Types.ObjectId | ||
: S extends Source.Redis | ||
? string | ||
: S extends Source.Mysql | ||
? string | ||
: S extends Source.Postgres | ||
? string | ||
: never; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { default as TypeormJobLock } from "./typeorm"; | ||
export default interface BaseJobLock<T> { | ||
_id: T | null; | ||
jobName: string; | ||
jobInterval: number; | ||
jobIntervalEndedAt: Date; | ||
isActive: boolean; | ||
createdAt: Date; | ||
updatedAt: Date; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,17 @@ | ||
/** | ||
* @public | ||
*/ | ||
export type { default as BaseJobStore } from "./base"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { default as MongodbJobStore } from "./mongodb"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { default as RedisJobStore } from "./redis"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { default as MysqlJobStore } from "./typeorm/mysql"; | ||
import type BaseJobLock from "../job-lock"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { default as PostgresJobStore } from "./typeorm/postgres"; | ||
export default interface BaseJobStore<T> { | ||
close(): Promise<void>; | ||
fetchLastJobLock(jobName: string): Promise<BaseJobLock<T> | null>; | ||
activateJobLock( | ||
jobName: string, | ||
jobInterval: number, | ||
jobIntervalEndedAt: Date, | ||
retryIntervalStartedAt: Date, | ||
): Promise<BaseJobLock<T> | null>; | ||
deactivateJobLock(jobName: string, jobId: T): Promise<BaseJobLock<T>>; | ||
removeJobLock(jobName: string, jobId: T): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.