| |
@@ -41,6 +41,7 @@
|
| |
import os
|
| |
import shutil
|
| |
import tempfile
|
| |
+ import time
|
| |
import hashlib
|
| |
import xml.etree.ElementTree as ET
|
| |
|
| |
@@ -504,11 +505,24 @@
|
| |
#)
|
| |
|
| |
# In serial
|
| |
+ sleep_for = CONFIG.get('CRON_SLEEP', 30)
|
| |
for t in itertools.product(
|
| |
- [CONFIG.get('DB_FOLDER', '/var/tmp')],
|
| |
- repositories):
|
| |
-
|
| |
- process_repo(t)
|
| |
+ [CONFIG.get('DB_FOLDER', '/var/tmp')],
|
| |
+ repositories):
|
| |
+
|
| |
+ loop = True
|
| |
+ cnt = 0
|
| |
+ while loop:
|
| |
+ cnt += 1
|
| |
+ try:
|
| |
+ process_repo(t)
|
| |
+ loop = False
|
| |
+ except OSError:
|
| |
+ if cnt == 4:
|
| |
+ raise
|
| |
+ # Most often due to an invalid stream, so let's try a second time
|
| |
+ time.sleep(sleep_for)
|
| |
+ process_repo(t)
|
| |
|
| |
return 0
|
| |
|
| |