ffffng/server/jobs/FixNodeFilenamesJob.ts
baldo 8b8835e4ac Typescript migration:
* Refactoring of scheduler and jobs to use promises.
* Add "failed" state for tasks.
2020-04-08 23:41:04 +02:00

22 lines
680 B
TypeScript

import Logger from "../logger";
import NodeService from "../services/nodeService";
export default {
name: 'FixNodeFilenamesJob',
description: 'Makes sure node files (holding fastd key, name, etc.) are correctly named.',
run: (): Promise<void> => {
return new Promise<void>(
(resolve, reject) => {
NodeService.fixNodeFilenames((err: any): void => {
if (err) {
Logger.tag('nodes', 'fix-filenames').error('Error fixing filenames:', err);
return reject(err);
}
resolve();
});
}
);
}
}