Skip to content

Commit

Permalink
chore: flush redis on storage plugin load
Browse files Browse the repository at this point in the history
  • Loading branch information
deanpress committed Feb 1, 2020
1 parent 03c0f8a commit f43396a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "reflect-metadata";
import { createConnection, getConnection } from "typeorm";
import { defaults } from "./defaults";
import { startServer } from "./server";
import { createHandyClient } from "handy-redis";

// Queue
import queue from "queue";
Expand Down Expand Up @@ -37,6 +38,9 @@ export const plugin: Container.IPluginDescriptor = {
container.resolvePlugin<Logger.ILogger>("logger").info(`Registering Storage Plug-in.`);
container.resolvePlugin<Logger.ILogger>("logger").info(`Storage Plug-in Database Path: ${dbPath}`);

const redis = createHandyClient();
await redis.flushdb();

await createConnection({
type: "sqlite",
database: dbPath,
Expand Down

0 comments on commit f43396a

Please sign in to comment.