ActivityPub-federated video streaming platform using P2P directly in your web browser
Remove tmp file on image processing error
Chocobozzz4ee7a4c9ac92
diff --git a/server/helpers/requests.ts b/server/helpers/requests.tsindex 60c94da811..8dda6c039c 100644--- a/server/helpers/requests.ts+++ b/server/helpers/requests.ts@@ -50,7 +50,14 @@ async function downloadImage (url: string, destDir: string, destName: string, siawait doRequestAndSaveToFile({ method: 'GET', uri: url }, tmpPath)const destPath = join(destDir, destName)- await processImage({ path: tmpPath }, destPath, size)++ try {+ await processImage({ path: tmpPath }, destPath, size)+ } catch (err) {+ await remove(tmpPath)++ throw err+ }}// ---------------------------------------------------------------------------diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.tsindex 0db75906cf..25cd40905b 100644--- a/server/lib/activitypub/actor.ts+++ b/server/lib/activitypub/actor.ts@@ -270,7 +270,7 @@ async function refreshActorIfNeeded (return { refreshed: true, actor }})} catch (err) {- logger.warn('Cannot refresh actor.', { err })+ logger.warn('Cannot refresh actor %s.', actor.url, { err })return { actor, refreshed: false }}}