From 0f4ee60246f918a8a704a7e8a726a948b93f2999 Mon Sep 17 00:00:00 2001 From: Jacob Weisz Date: Sat, 16 Mar 2024 05:44:51 +0000 Subject: [PATCH] Sandstorm: Clean up uploads (#73) So one issue I've found is that sometimes Sandstorm will kill a grain while it is still transcoding (on my todo list, figure out how to lock the grain open during transcoding...). When that happens, a tube-transcode- and tube-upload- file each get left behind in the uploads directory. If I understand this correctly, tube should never look for those files again, and they are just storage waste. In the case of a grain I made today, the uploads directory remains half the grain's size, even though the actual videos tube serves are elsewhere. So I believe that I wrote this correctly, but haven't tested it yet: When launching the Sandstorm grain, we should just dump the contents of the uploads directory to clean up unusable data. Reviewed-on: https://git.mills.io/prologic/tube/pulls/73 Reviewed-by: James Mills Co-authored-by: Jacob Weisz Co-committed-by: Jacob Weisz --- .sandstorm/launcher.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.sandstorm/launcher.sh b/.sandstorm/launcher.sh index f15c7d0..8d0ef82 100644 --- a/.sandstorm/launcher.sh +++ b/.sandstorm/launcher.sh @@ -1 +1,2 @@ +rm -f /var/uploads/* exec /opt/app/tube -c /opt/app/.sandstorm/config.json