mirror of
https://github.com/outline/outline.git
synced 2026-11-28 00:09:58 +03:00
fix: regressions
This commit is contained in:
1 parent
a049cc19c2
commit
3abebc6589
2 files changed
+9
-2
No files matched your search
@@ -3,6 +3,7 @@ import { unlink } from "fs/promises";
|
||||
import path from "path";
|
||||
import JWT from "jsonwebtoken";
|
||||
import env from "@server/env";
|
||||
import Logger from "@server/logging/Logger";
|
||||
import fetch from "@server/utils/fetch";
|
||||
import BaseStorage from "./BaseStorage";
|
||||
|
||||
@@ -69,7 +70,11 @@ export default class LocalStorage extends BaseStorage {
|
||||
|
||||
public async deleteFile(key: string) {
|
||||
const filePath = path.join(env.FILE_STORAGE_LOCAL_ROOT, key);
|
||||
return unlink(filePath);
|
||||
try {
|
||||
await unlink(filePath);
|
||||
} catch (err) {
|
||||
Logger.warn(`Couldn't delete ${filePath}`, err);
|
||||
}
|
||||
}
|
||||
|
||||
public getSignedUrl = async (key: string, expiresIn = 60) => {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
export default {
|
||||
upload: jest.fn().mockReturnValue("/endpoint/key"),
|
||||
|
||||
getPublicEndpoint: jest.fn().mockReturnValue("http://mock"),
|
||||
getUploadUrl: jest.fn().mockReturnValue("http://mock/create"),
|
||||
|
||||
getUrlForKey: jest.fn().mockReturnValue("http://mock/get"),
|
||||
|
||||
getSignedUrl: jest.fn().mockReturnValue("http://s3mock"),
|
||||
|
||||
|
||||
Reference in new issue
Block a user