diff options
author | eug-vs <eug-vs@keemail.me> | 2020-12-02 01:47:43 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-12-02 01:47:43 +0300 |
commit | 1497c063bb7714e633603b1752fd18b635c868d9 (patch) | |
tree | 22704eb9596fe9173495f30d8d37f24046abe34c | |
parent | fffd3bce9dc5fde83fb765f384b32622c578f33f (diff) | |
download | mongo-cronjob-1497c063bb7714e633603b1752fd18b635c868d9.tar.gz |
fix: remove some schema restrictions
-rw-r--r-- | lib/schema.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/schema.ts b/lib/schema.ts index 4e5dd69..1bba77d 100644 --- a/lib/schema.ts +++ b/lib/schema.ts @@ -6,15 +6,14 @@ export interface EventDocument<Context> extends Document { status: 'notStarted' | 'running' | 'complete' | 'failed'; error?: string; context: Context; - nextRunAt: Date; - lastRunAt: Date; + nextRunAt?: Date; + lastRunAt?: Date; } const createEventSchema = (contextSchema: Schema) => new Schema({ name: { type: String, - required: true, - unique: true + required: true }, schedule: { type: String, |