forked from artic-network/rampart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrampart.js
executable file
·33 lines (26 loc) · 1.08 KB
/
rampart.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env node
const server = require("./server/server");
const { parser } = require("./server/args");
const { getInitialConfig } = require("./server/config/getInitialConfig");
const { processExistingData } = require("./server/startUp");
const { startBasecalledFilesWatcher } = require("./server/watchBasecalledFiles");
const Datastore = require("./server/datastore").default;
const { fatal, trace } = require('./server/utils');
const main = async () => {
try {
const args = parser.parseArgs();
if (args.verbose) global.VERBOSE = true;
const {config, pipelineRunners} = getInitialConfig(args);
global.config = config;
global.pipelineRunners = pipelineRunners;
global.datastore = new Datastore();
global.filesSeen = new Set(); /* files (basenames) seen (FASTQ or CSV) */
server.run({devClient: args.devClient, ports: args.ports});
await processExistingData();
await startBasecalledFilesWatcher();
} catch (err) {
trace(err);
fatal(`Fatal error: ${err.message}`);
}
};
main();