diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-05-27 16:54:47 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-05-27 16:54:47 +0900 |
| commit | 72fb23f4d51db1b999a10b7d8bb50293a81af163 (patch) | |
| tree | 07a7fa62cb7a822ce3759db5b2035368cd4e8e29 /src/tools | |
| parent | Improve post form (diff) | |
| download | sharkey-72fb23f4d51db1b999a10b7d8bb50293a81af163.tar.gz sharkey-72fb23f4d51db1b999a10b7d8bb50293a81af163.tar.bz2 sharkey-72fb23f4d51db1b999a10b7d8bb50293a81af163.zip | |
Improve drive management
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/clean-remote-files.ts | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/tools/clean-remote-files.ts b/src/tools/clean-remote-files.ts deleted file mode 100644 index 633a6fc04d..0000000000 --- a/src/tools/clean-remote-files.ts +++ /dev/null @@ -1,26 +0,0 @@ -import * as promiseLimit from 'promise-limit'; -import del from '../services/drive/delete-file'; -import { DriveFiles } from '../models'; -import { Not, IsNull } from 'typeorm'; -import { DriveFile } from '../models/entities/drive-file'; -import { ensure } from '../prelude/ensure'; - -const limit = promiseLimit(16); - -DriveFiles.find({ - userHost: Not(IsNull()) -}).then(async files => { - console.log(`there is ${files.length} files`); - - await Promise.all(files.map(file => limit(() => job(file)))); - - console.log('ALL DONE'); -}); - -async function job(file: DriveFile): Promise<any> { - file = await DriveFiles.findOne(file.id).then(ensure); - - await del(file, true); - - console.log('done', file.id); -} |