示例#1
0
 def custom_exp_backoff(*args, **kwargs):
     if max_repeat:
         kwargs["max_repeat"] = max_repeat
     if get_cache_value(uid=task_uid, attribute="status", model_name="ExportTaskRecord") == TaskState.CANCELED.value:
         logger.error(f"The task uid: {task_uid} was canceled. Exiting...")
         raise Exception("The task was canceled.")
     exp_backoff(*args, **kwargs)
示例#2
0
 def work_loop(self):
     while True:
         tiles = self.tiles_queue.get()
         if tiles is None:
             return
         with self.tile_mgr.session():
             exp_backoff(self.tile_mgr.load_tile_coords, args=(tiles,),
                     exceptions=(SourceError, IOError), ignore_exceptions=(LockTimeout, ))
示例#3
0
 def work_loop(self):
     while True:
         tiles = self.tiles_queue.get()
         if tiles is None:
             return
         with self.tile_mgr.session():
             exp_backoff(self.tile_mgr.load_tile_coords, args=(tiles,),
                 max_repeat=100, max_backoff=600,
                 exceptions=(SourceError, IOError), ignore_exceptions=(LockTimeout, ))
示例#4
0
 def custom_exp_backoff(*args, **kwargs):
     if max_repeat:
         kwargs['max_repeat'] = max_repeat
     exp_backoff(*args, **kwargs)
示例#5
0
 def custom_exp_backoff(*args, **kwargs):
     if max_repeat:
         kwargs['max_repeat'] = max_repeat
     exp_backoff(*args, **kwargs)