pass arguments to CleanRemoteFiles job
This commit is contained in:
parent
c68b8d6e7c
commit
50ca5e8688
1 changed files with 8 additions and 2 deletions
|
|
@ -18,7 +18,10 @@ export const meta = {
|
||||||
|
|
||||||
export const paramDef = {
|
export const paramDef = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {},
|
properties: {
|
||||||
|
olderThanSeconds: { type: 'number' },
|
||||||
|
keepFilesInUse: { type: 'boolean' },
|
||||||
|
},
|
||||||
required: [],
|
required: [],
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|
@ -30,7 +33,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
await this.moderationLogService.log(me, 'clearRemoteFiles', {});
|
await this.moderationLogService.log(me, 'clearRemoteFiles', {});
|
||||||
await this.queueService.createCleanRemoteFilesJob();
|
await this.queueService.createCleanRemoteFilesJob(
|
||||||
|
ps.olderThanSeconds ?? 0,
|
||||||
|
ps.keepFilesInUse ?? false,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue