Spaces:
Running
Running
mrfakename
commited on
Commit
•
29874d6
1
Parent(s):
5921fdd
Update app.py
Browse files
app.py
CHANGED
@@ -223,15 +223,19 @@ def sync_db():
|
|
223 |
token=os.getenv('HF_TOKEN')
|
224 |
)
|
225 |
while True:
|
226 |
-
# time.sleep(60 * 5)
|
227 |
time.sleep(5)
|
228 |
print("Uploading DB")
|
229 |
-
|
|
|
|
|
|
|
|
|
|
|
230 |
path_or_fileobj='database.db',
|
231 |
path_in_repo='database.db',
|
232 |
repo_id=os.getenv('DATASET_ID'),
|
233 |
repo_type='dataset'
|
234 |
-
)
|
235 |
if os.getenv('HF_ID'):
|
236 |
restart_thread = threading.Thread(target=restart_space)
|
237 |
restart_thread.daemon = True
|
|
|
223 |
token=os.getenv('HF_TOKEN')
|
224 |
)
|
225 |
while True:
|
|
|
226 |
time.sleep(5)
|
227 |
print("Uploading DB")
|
228 |
+
api.delete_file(
|
229 |
+
path_in_repo='database.db',
|
230 |
+
repo_id=os.getenv('DATASET_ID'),
|
231 |
+
repo_type='dataset'
|
232 |
+
)
|
233 |
+
api.upload_file(
|
234 |
path_or_fileobj='database.db',
|
235 |
path_in_repo='database.db',
|
236 |
repo_id=os.getenv('DATASET_ID'),
|
237 |
repo_type='dataset'
|
238 |
+
)
|
239 |
if os.getenv('HF_ID'):
|
240 |
restart_thread = threading.Thread(target=restart_space)
|
241 |
restart_thread.daemon = True
|