mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: storage: update index
This commit is contained in:
1 parent
bf2179d56c
commit
9b0b8aba61
2 files changed
+12
-1
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.32.25",
|
"version": "2.32.26",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import yaml from 'js-yaml';
|
|||||||
import { pick } from 'lodash';
|
import { pick } from 'lodash';
|
||||||
import { convertIniConfig } from '@hydrooj/utils/lib/cases';
|
import { convertIniConfig } from '@hydrooj/utils/lib/cases';
|
||||||
import { BucketItem } from 'minio';
|
import { BucketItem } from 'minio';
|
||||||
|
import moment from 'moment';
|
||||||
import { Progress } from './ui';
|
import { Progress } from './ui';
|
||||||
import { Logger } from './logger';
|
import { Logger } from './logger';
|
||||||
import { streamToBuffer } from './utils';
|
import { streamToBuffer } from './utils';
|
||||||
@@ -446,6 +447,16 @@ const scripts: UpgradeScript[] = [
|
|||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
async function _40_41() {
|
||||||
|
const _FRESH_INSTALL_IGNORE = 1;
|
||||||
|
await db.collection('storage').dropIndex('path_1');
|
||||||
|
await db.collection('storage').createIndex({ path: 1, autoDelete: 1 }, { sparse: true });
|
||||||
|
await db.collection('storage').updateMany(
|
||||||
|
{ autoDelete: { $gte: moment().add(5, 'days').toDate() } },
|
||||||
|
{ $unset: { autoDelete: '' } },
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default scripts;
|
export default scripts;
|
||||||
Reference in new issue
Block a user