Open medoledltd opened 3 years ago
Just as a supplement, I did this in my wasm proxy tooling which worked quite nice:
**snip**
with tempfile.TemporaryDirectory() as td:
# Extract zip (job data)
os.chdir(td)
self.extract_zip(td, job_data["zip"])
with DirectoryDiff(td) as directory:
# Run Task
proc = subprocess.run(cmd, stdout=subprocess.PIPE)
result = proc.stdout.decode()
# Diff task directory and zip new files
new_files = directory.diff()
zip_file = self.zip_diff(td, new_files)
**snip**
Could probably be done similarly usingRust
Truebit OS does not seem to delete the temporary folders created for tasks. It could be a configuration option to delete the folders after x number of days, either during startup of Truebit OS or during task execution. Example to delete folders older than 3 days:
find /truebit-eth -name 'tmp.*' -type d -daystart -mtime +3 -delete