feat(server): restore modified at timestamp after upload, preserve when copying (#7010)

This commit is contained in:
Trevor Jex
2024-02-11 21:40:34 -07:00
committed by GitHub
parent 0c4df216d7
commit d7437d31d1
7 changed files with 49 additions and 3 deletions
@@ -12,7 +12,7 @@ import archiver from 'archiver';
import chokidar, { WatchOptions } from 'chokidar';
import { glob } from 'glob';
import { constants, createReadStream, existsSync, mkdirSync } from 'node:fs';
import fs, { copyFile, readdir, rename, writeFile } from 'node:fs/promises';
import fs, { copyFile, readdir, rename, utimes, writeFile } from 'node:fs/promises';
import path from 'node:path';
export class FilesystemProvider implements IStorageRepository {
@@ -56,6 +56,8 @@ export class FilesystemProvider implements IStorageRepository {
copyFile = copyFile;
utimes = utimes;
async checkFileExists(filepath: string, mode = constants.F_OK): Promise<boolean> {
try {
await fs.access(filepath, mode);