diff --git a/README.md b/README.md index da2636cc2..8ab927806 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ please refer to the [architecture document](ARCHITECTURE.md) first for a high le Outline uses [debug](https://www.npmjs.com/package/debug). To enable debugging output, the following categories are available: ``` -DEBUG=sql,cache,presenters,events,logistics,emails,mailer +DEBUG=sql,cache,presenters,events,importer,exporter,emails,mailer ``` ## Tests diff --git a/server/api/collections.js b/server/api/collections.js index bb3997a16..fadae36d5 100644 --- a/server/api/collections.js +++ b/server/api/collections.js @@ -2,7 +2,7 @@ import fs from "fs"; import Router from "koa-router"; import { ValidationError } from "../errors"; -import { exportCollections } from "../logistics"; +import { exportCollections } from "../exporter"; import auth from "../middlewares/authentication"; import { Collection, diff --git a/server/logistics.js b/server/exporter.js similarity index 89% rename from server/logistics.js rename to server/exporter.js index a62ade09c..518990ead 100644 --- a/server/logistics.js +++ b/server/exporter.js @@ -4,8 +4,8 @@ import mailer from "./mailer"; import { Collection, Team } from "./models"; import { createQueue } from "./utils/queue"; -const log = debug("logistics"); -const logisticsQueue = createQueue("logistics"); +const log = debug("exporter"); +const exporterQueue = createQueue("exporter"); const queueOptions = { attempts: 2, removeOnComplete: true, @@ -38,7 +38,7 @@ async function exportAndEmailCollections(teamId: string, email: string) { }); } -logisticsQueue.process(async (job) => { +exporterQueue.process(async (job) => { log("Process", job.data); switch (job.data.type) { @@ -49,7 +49,7 @@ logisticsQueue.process(async (job) => { }); export const exportCollections = (teamId: string, email: string) => { - logisticsQueue.add( + exporterQueue.add( { type: "export-collections", teamId,