Skip to content

Commit 33d183d

Browse files
Also fix permissions on files that gets overwritten during run_graph_locally. eu-cdse/openeo-cdse-infra#426
1 parent c01e291 commit 33d183d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

openeogeotrellis/deploy/run_graph_locally.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
import os
33
import sys
4+
from datetime import datetime
45
from pathlib import Path
56

67

@@ -11,6 +12,7 @@
1112

1213
def run_graph_locally(process_graph, output_dir):
1314
files_orig = set(output_dir.rglob("*"))
15+
process_start = datetime.now()
1416
output_dir = ensure_dir(output_dir)
1517
setup_environment(output_dir)
1618
# Can only import after setup_environment:
@@ -31,7 +33,8 @@ def run_graph_locally(process_graph, output_dir):
3133
)
3234
# Set the permissions so any user can read and delete the files:
3335
# For when running inside a docker container.
34-
files_new = set(output_dir.rglob("*")) - files_orig
36+
files_now = set(output_dir.rglob("*"))
37+
files_new = filter(lambda f: f not in files_orig or f.stat().st_mtime > process_start.timestamp(), files_now)
3538
for file in files_new:
3639
if file.is_file():
3740
os.chmod(file, 0o666)

0 commit comments

Comments
 (0)