File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
import json
2
2
import os
3
3
import sys
4
+ from datetime import datetime
4
5
from pathlib import Path
5
6
6
7
11
12
12
13
def run_graph_locally (process_graph , output_dir ):
13
14
files_orig = set (output_dir .rglob ("*" ))
15
+ process_start = datetime .now ()
14
16
output_dir = ensure_dir (output_dir )
15
17
setup_environment (output_dir )
16
18
# Can only import after setup_environment:
@@ -31,7 +33,8 @@ def run_graph_locally(process_graph, output_dir):
31
33
)
32
34
# Set the permissions so any user can read and delete the files:
33
35
# 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 )
35
38
for file in files_new :
36
39
if file .is_file ():
37
40
os .chmod (file , 0o666 )
You can’t perform that action at this time.
0 commit comments