Have storage replication wait up to 20 minutes before trying again
Copying a file can be a long operation, so make this configurable and far above the default 5 minutes
This commit is contained in:
parent
789e35668c
commit
b05ebbf2c0
1 changed files with 3 additions and 1 deletions
|
@ -10,6 +10,7 @@ from workers.queueworker import QueueWorker, WorkerUnhealthyException
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
POLL_PERIOD_SECONDS = 10
|
POLL_PERIOD_SECONDS = 10
|
||||||
|
RESERVATION_SECONDS = app.config.get('STORAGE_REPLICATION_PROCESSING_SECONDS', 60*20)
|
||||||
|
|
||||||
class StorageReplicationWorker(QueueWorker):
|
class StorageReplicationWorker(QueueWorker):
|
||||||
def process_queue_item(self, job_details):
|
def process_queue_item(self, job_details):
|
||||||
|
@ -97,5 +98,6 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
logger.debug('Starting replication worker')
|
logger.debug('Starting replication worker')
|
||||||
worker = StorageReplicationWorker(image_replication_queue,
|
worker = StorageReplicationWorker(image_replication_queue,
|
||||||
poll_period_seconds=POLL_PERIOD_SECONDS)
|
poll_period_seconds=POLL_PERIOD_SECONDS,
|
||||||
|
reservation_seconds=RESERVATION_SECONDS)
|
||||||
worker.start()
|
worker.start()
|
||||||
|
|
Reference in a new issue