Finch- Refactoring lock context

Making the lock context as a separate wrapping function

Reviewed by:None
Testing:Manual
Tickets:
Backport: