|
23 | 23 | """ |
24 | 24 |
|
25 | 25 | load_dotenv() |
26 | | -data = json.loads(os.getenv('PGDB_TANK')) |
| 26 | +data = json.loads(os.getenv('PGDB_LOCAL')) |
27 | 27 | conn = psycopg2.connect(**data, connect_timeout = 5) |
28 | 28 | cur = conn.cursor() |
29 | 29 | args = nh.parse_arguments() |
|
135 | 135 | not_uploaded_files = "data/NODE/failed_uploads" |
136 | 136 | os.makedirs(not_uploaded_files, exist_ok=True) |
137 | 137 | not_uploaded_path = os.path.join(not_uploaded_files, os.path.basename(filename)) |
138 | | - #os.replace(filename, not_uploaded_path) |
| 138 | + os.replace(filename, not_uploaded_path) |
139 | 139 | print(f"filename {filename} could not be uploaded.") |
140 | 140 | os.makedirs('data/NODE/upload_logs/failed_uploads/', exist_ok=True) |
141 | 141 | modified_filename = filename.replace('data/NODE/', 'data/NODE/upload_logs/failed_uploads/') |
|
151 | 151 | logfile.append(f"✗ File upload failed: {e}") |
152 | 152 | os.makedirs(not_uploaded_files, exist_ok=True) |
153 | 153 | not_uploaded_path = os.path.join(not_uploaded_files, os.path.basename(filename)) |
154 | | - #os.replace(filename, not_uploaded_path) |
| 154 | + os.replace(filename, not_uploaded_path) |
155 | 155 | os.makedirs('data/NODE/upload_logs/failed_uploads/', exist_ok=True) |
156 | 156 | modified_filename = filename.replace('data/NODE/', 'data/NODE/upload_logs/failed_uploads/') |
157 | 157 | with open(modified_filename + '.upload.log', 'w', encoding = "utf-8") as writer: |
|
0 commit comments