Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
fix(cli): purge on start before app is created
Browse files Browse the repository at this point in the history
When appFactory() is called the blockchain watchers are setup
 which also loads all past events, which would then be purged.
  • Loading branch information
AuHau committed Apr 23, 2020
1 parent 8b6fd05 commit b99d137
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cli/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { appFactory, isSupportedServices, services, SupportedServices } from '..
import { loggingFactory } from '../logger'
import { Flags, Config } from '../types'
import { BaseCLICommand } from '../utils'
import { sequelizeFactory } from '../sequelize'

const logger = loggingFactory('cli:start')

Expand Down Expand Up @@ -101,12 +102,12 @@ ${formattedServices}`
const configOverrides = this.buildConfigObject(flags)
config.util.extendDeep(config, configOverrides)

const app = appFactory()

if (flags.purge) {
sequelizeFactory()
await this.purge()
}

const app = appFactory()
const port = config.get('port')
const server = app.listen(port)

Expand Down

0 comments on commit b99d137

Please sign in to comment.