mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature: thread-it: get rid (#438)
This commit is contained in:
parent
99ad0c217d
commit
4ab4be124b
4 changed files with 2 additions and 10 deletions
|
|
@ -5,14 +5,12 @@ const {callbackify} = require('node:util');
|
|||
|
||||
const pullout = require('pullout');
|
||||
const ponse = require('ponse');
|
||||
const threadIt = require('thread-it');
|
||||
const {read} = require('redzip');
|
||||
|
||||
const root = require('../root');
|
||||
const isString = (a) => typeof a === 'string';
|
||||
const parse = threadIt(join(__dirname, 'worker'));
|
||||
const parse = require('./worker');
|
||||
|
||||
threadIt.init();
|
||||
// warm up
|
||||
parse('');
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import {Server} from 'socket.io';
|
|||
import tryRequire from 'tryrequire';
|
||||
import wraptile from 'wraptile';
|
||||
import compression from 'compression';
|
||||
import threadIt from 'thread-it';
|
||||
import exit from './exit.js';
|
||||
import cloudcmd from './cloudcmd.mjs';
|
||||
|
||||
|
|
@ -20,7 +19,6 @@ const two = currify((f, a, b) => f(a, b));
|
|||
const shutdown = wraptile(async (promises) => {
|
||||
console.log('closing cloudcmd...');
|
||||
await Promise.all(promises);
|
||||
threadIt.terminate();
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -5,13 +5,10 @@ import {join} from 'node:path';
|
|||
import montag from 'montag';
|
||||
import tryToCatch from 'try-to-catch';
|
||||
import currify from 'currify';
|
||||
import threadIt from 'thread-it';
|
||||
import {codeframe} from 'putout';
|
||||
import {putout, codeframe} from 'putout';
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const putout = threadIt(require.resolve('putout'));
|
||||
|
||||
threadIt.init();
|
||||
// warm up worker cache
|
||||
transpile('');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue