logistics -> exporter, remove cutesy naming of lib
This commit is contained in:
@@ -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:
|
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
|
## Tests
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import Router from "koa-router";
|
import Router from "koa-router";
|
||||||
import { ValidationError } from "../errors";
|
import { ValidationError } from "../errors";
|
||||||
import { exportCollections } from "../logistics";
|
import { exportCollections } from "../exporter";
|
||||||
import auth from "../middlewares/authentication";
|
import auth from "../middlewares/authentication";
|
||||||
import {
|
import {
|
||||||
Collection,
|
Collection,
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import mailer from "./mailer";
|
|||||||
import { Collection, Team } from "./models";
|
import { Collection, Team } from "./models";
|
||||||
import { createQueue } from "./utils/queue";
|
import { createQueue } from "./utils/queue";
|
||||||
|
|
||||||
const log = debug("logistics");
|
const log = debug("exporter");
|
||||||
const logisticsQueue = createQueue("logistics");
|
const exporterQueue = createQueue("exporter");
|
||||||
const queueOptions = {
|
const queueOptions = {
|
||||||
attempts: 2,
|
attempts: 2,
|
||||||
removeOnComplete: true,
|
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);
|
log("Process", job.data);
|
||||||
|
|
||||||
switch (job.data.type) {
|
switch (job.data.type) {
|
||||||
@@ -49,7 +49,7 @@ logisticsQueue.process(async (job) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const exportCollections = (teamId: string, email: string) => {
|
export const exportCollections = (teamId: string, email: string) => {
|
||||||
logisticsQueue.add(
|
exporterQueue.add(
|
||||||
{
|
{
|
||||||
type: "export-collections",
|
type: "export-collections",
|
||||||
teamId,
|
teamId,
|
||||||
Reference in New Issue
Block a user