mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
Fix types
This commit is contained in:
parent
b7529b13e1
commit
1c9e2a08aa
@ -1,18 +1,11 @@
|
||||
import * as cluster from 'cluster';
|
||||
import { Worker } from 'cluster';
|
||||
import { Logger } from '../../Logger';
|
||||
import {
|
||||
DiskManagerTask,
|
||||
ThumbnailTask,
|
||||
WorkerMessage,
|
||||
WorkerTask,
|
||||
WorkerTaskTypes,
|
||||
} from './Worker';
|
||||
import { ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO';
|
||||
import { RendererInput } from './PhotoWorker';
|
||||
import { TaskQue, TaskQueEntry } from './TaskQue';
|
||||
import { ITaskExecuter } from './TaskExecuter';
|
||||
import { DirectoryScanSettings } from './DiskMangerWorker';
|
||||
import {Worker} from 'cluster';
|
||||
import {Logger} from '../../Logger';
|
||||
import {DiskManagerTask, WorkerMessage, WorkerTask, WorkerTaskTypes,} from './Worker';
|
||||
import {ParentDirectoryDTO} from '../../../common/entities/DirectoryDTO';
|
||||
import {TaskQue, TaskQueEntry} from './TaskQue';
|
||||
import {ITaskExecuter} from './TaskExecuter';
|
||||
import {DirectoryScanSettings} from './DiskMangerWorker';
|
||||
|
||||
interface WorkerWrapper<O> {
|
||||
worker: Worker;
|
||||
@ -81,12 +74,12 @@ export class ThreadPool<O> {
|
||||
Logger.warn(
|
||||
LOG_TAG,
|
||||
'Worker ' +
|
||||
worker.worker.process.pid +
|
||||
' died with code: ' +
|
||||
code +
|
||||
', and signal: ' +
|
||||
signal +
|
||||
', worker count:',
|
||||
worker.worker.process.pid +
|
||||
' died with code: ' +
|
||||
code +
|
||||
', and signal: ' +
|
||||
signal +
|
||||
', worker count:',
|
||||
ThreadPool.WorkerCount
|
||||
);
|
||||
Logger.debug(LOG_TAG, 'Starting a new worker');
|
||||
@ -111,8 +104,7 @@ export class ThreadPool<O> {
|
||||
|
||||
export class DiskManagerTH
|
||||
extends ThreadPool<ParentDirectoryDTO>
|
||||
implements ITaskExecuter<string, ParentDirectoryDTO>
|
||||
{
|
||||
implements ITaskExecuter<string, ParentDirectoryDTO> {
|
||||
execute(
|
||||
relativeDirectoryName: string,
|
||||
settings: DirectoryScanSettings = {}
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { DirectoryScanSettings, DiskMangerWorker } from './DiskMangerWorker';
|
||||
import { Logger } from '../../Logger';
|
||||
import { PhotoWorker, RendererInput } from './PhotoWorker';
|
||||
import { Utils } from '../../../common/Utils';
|
||||
import { MediaDTO } from '../../../common/entities/MediaDTO';
|
||||
import { ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO';
|
||||
import {DirectoryScanSettings, DiskMangerWorker} from './DiskMangerWorker';
|
||||
import {Logger} from '../../Logger';
|
||||
import {MediaRendererInput, PhotoWorker} from './PhotoWorker';
|
||||
import {Utils} from '../../../common/Utils';
|
||||
import {MediaDTO} from '../../../common/entities/MediaDTO';
|
||||
import {ParentDirectoryDTO} from '../../../common/entities/DirectoryDTO';
|
||||
|
||||
declare const process: NodeJS.Process;
|
||||
const LOG_TAG = '[Worker]';
|
||||
@ -35,7 +35,7 @@ export class Worker {
|
||||
result,
|
||||
} as WorkerMessage<O>);
|
||||
} catch (err) {
|
||||
process.send({ error: err, result: null });
|
||||
process.send({error: err, result: null});
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -56,7 +56,7 @@ export interface DiskManagerTask extends WorkerTask {
|
||||
}
|
||||
|
||||
export interface ThumbnailTask extends WorkerTask {
|
||||
input: RendererInput;
|
||||
input: MediaRendererInput;
|
||||
}
|
||||
|
||||
export const WorkerTask = {
|
||||
|
Loading…
Reference in New Issue
Block a user