Skip to content

Commit

Permalink
bypass instance id validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Júnior committed Aug 19, 2021
1 parent 8684564 commit 84ee17e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions networkapi/util/geral.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ def create_lock_with_blocking(locks_name):
for lock_name in locks_name:
try:
lock = distributedlock(lock_name, blocking=False)
# TODO: This is a temporary solution for a high needed change. In the future we need to validate
# why destroy_lock in models/create_v3 didn't work some times

if lock.get_cached_data():
log.info('Get cached lock data for {}. Disabling it and creating a new lock'.format(lock_name))
lock.lock.instance_id = lock.get_cached_data()
lock.__exit__('', '', '')
lock.__enter__()
locks_list.append(lock)
Expand Down

0 comments on commit 84ee17e

Please sign in to comment.