Add support for jobs & queueables, migrations
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is failing

- Create migration directives & migrators
- Modify Cache classes to support array manipulation
- Create Redis unit and RedisCache implementation
- Create Queueable base class and Queue class that uses Cache backend
This commit is contained in:
2021-08-23 23:51:53 -05:00
parent 26e0444e40
commit 074a3187eb
28 changed files with 962 additions and 56 deletions

View File

@@ -3,10 +3,10 @@ import {Awaitable, collect, ErrorWithContext} from '../../util'
import {Migration} from './Migration'
import {Migrations} from '../services/Migrations'
import {EventBus} from '../../event/EventBus'
import {ApplyingMigrationEvent} from './events/ApplyingMigrationEvent'
import {AppliedMigrationEvent} from './events/AppliedMigrationEvent'
import {RollingBackMigrationEvent} from './events/RollingBackMigrationEvent'
import {RolledBackMigrationEvent} from './events/RolledBackMigrationEvent'
// import {ApplyingMigrationEvent} from './events/ApplyingMigrationEvent'
// import {AppliedMigrationEvent} from './events/AppliedMigrationEvent'
// import {RollingBackMigrationEvent} from './events/RollingBackMigrationEvent'
// import {RolledBackMigrationEvent} from './events/RolledBackMigrationEvent'
import {NothingToMigrateError} from './NothingToMigrateError'
/**
@@ -259,8 +259,8 @@ export abstract class Migrator {
* @protected
*/
protected async applying(migration: Migration): Promise<void> {
const event = <ApplyingMigrationEvent> this.injector.make(ApplyingMigrationEvent, migration)
await this.bus.dispatch(event)
// const event = <ApplyingMigrationEvent> this.injector.make(ApplyingMigrationEvent, migration)
// await this.bus.dispatch(event)
}
/**
@@ -269,8 +269,8 @@ export abstract class Migrator {
* @protected
*/
protected async applied(migration: Migration): Promise<void> {
const event = <AppliedMigrationEvent> this.injector.make(AppliedMigrationEvent, migration)
await this.bus.dispatch(event)
// const event = <AppliedMigrationEvent> this.injector.make(AppliedMigrationEvent, migration)
// await this.bus.dispatch(event)
}
/**
@@ -279,8 +279,8 @@ export abstract class Migrator {
* @protected
*/
protected async rollingBack(migration: Migration): Promise<void> {
const event = <RollingBackMigrationEvent> this.injector.make(RollingBackMigrationEvent, migration)
await this.bus.dispatch(event)
// const event = <RollingBackMigrationEvent> this.injector.make(RollingBackMigrationEvent, migration)
// await this.bus.dispatch(event)
}
/**
@@ -289,7 +289,7 @@ export abstract class Migrator {
* @protected
*/
protected async rolledBack(migration: Migration): Promise<void> {
const event = <RolledBackMigrationEvent> this.injector.make(RolledBackMigrationEvent, migration)
await this.bus.dispatch(event)
// const event = <RolledBackMigrationEvent> this.injector.make(RolledBackMigrationEvent, migration)
// await this.bus.dispatch(event)
}
}