def _acquire_subtask_lock(task_id):
 key = 'subtask-{}'.format(task_id)
 succeeded = cache.add(key, 'true', SUBTASK_LOCK_EXPIRE)
 if (not succeeded):
  TASK_LOG.warning("task_id '%s': already locked.  Contains value '%s'", task_id, cache.get(key))
 return succeeded

def _acquire_subtask_lock ( task_id ) : key = 'subtask-{}' . format ( task_id ) succeeded = cache . add ( key , 'true' , SUBTASK_LOCK_EXPIRE ) if ( not succeeded ) : TASK_LOG . warning ( "task_id '%s': already locked.  Contains value '%s'" , task_id , cache . get ( key ) ) return succeeded
mark the specified task_id as being in progress .