diff options
author | eug-vs <eug-vs@keemail.me> | 2020-12-02 04:10:15 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-12-02 04:10:36 +0300 |
commit | 6f52408e7bf79730df9eb7b487dcacf468e409e1 (patch) | |
tree | 0bc1caf00ad8a95ac4faa438ff2f848529d36a2b /lib | |
parent | 40ffcc5e78f5ee41353e383ca25b81134084ab9f (diff) | |
download | mongo-cronjob-6f52408e7bf79730df9eb7b487dcacf468e409e1.tar.gz |
test: Event model
Diffstat (limited to 'lib')
-rw-r--r-- | lib/event.model.ts | 2 | ||||
-rw-r--r-- | lib/event.schema.ts | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/event.model.ts b/lib/event.model.ts index 7768ffc..1b6d324 100644 --- a/lib/event.model.ts +++ b/lib/event.model.ts @@ -5,7 +5,7 @@ import { LogDocument } from './log.schema'; import LogModel from './log.model'; export interface Event<Context> extends EventDocument<Context> { - log(message: string): void; + log(message: string): Promise<LogDocument>; start(): void; complete(): void; fail(error: Error | string): void; diff --git a/lib/event.schema.ts b/lib/event.schema.ts index 0f428fd..8b9db8b 100644 --- a/lib/event.schema.ts +++ b/lib/event.schema.ts @@ -3,7 +3,7 @@ import { Schema, Document } from 'mongoose'; export interface EventDocument<Context> extends Document { type: string; schedule: string; - status: 'notStarted' | 'running' | 'complete' | 'failed'; + status?: 'notStarted' | 'running' | 'complete' | 'failed'; error?: string; context: Context; nextRunAt?: Date; |