Skip to content

Commit

Permalink
fix: Remove old downloaded video when it gets refreshed
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedBassem committed Nov 9, 2024
1 parent f8bed57 commit a24755d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/workers/videoWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
getAssetSize,
newAssetId,
saveAssetFromFile,
silentDeleteAsset,
} from "@hoarder/shared/assetdb";
import serverConfig from "@hoarder/shared/config";
import logger from "@hoarder/shared/logger";
Expand Down Expand Up @@ -152,6 +153,7 @@ async function runWorker(job: DequeuedJob<ZVideoRequest>) {
txn,
);
});
await silentDeleteAsset(userId, oldVideoAssetId);

logger.info(
`[VideoCrawler][${jobId}] Finished downloading video from "${url}" and adding it to the database`,
Expand Down

0 comments on commit a24755d

Please sign in to comment.