mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 01:47:39 -07:00
Make media cleanup task respect timezone
This commit is contained in:
parent
079942eda4
commit
ed2622344f
1 changed files with 2 additions and 2 deletions
|
@ -14,12 +14,12 @@ export default async function cleanRemoteFiles(
|
|||
done: any,
|
||||
): Promise<void> {
|
||||
let progress = 0;
|
||||
let until = new Date();
|
||||
let until = new Date(Date.now() - ((new Date()).getTimezoneOffset() * 60000));
|
||||
until.setDate(until.getDate() - (config.mediaCleanup?.maxAgeDays ?? 0));
|
||||
const avatars = config.mediaCleanup?.avatars ?? false;
|
||||
const headers = config.mediaCleanup?.headers ?? false;
|
||||
|
||||
until = until.toISOString().replace("T", " ").replace("Z", "");
|
||||
until = until.toISOString().replace("T", " ").slice(0, -1);
|
||||
|
||||
let target = "files";
|
||||
if (avatars)
|
||||
|
|
Loading…
Reference in a new issue