From cb7e6e89a58fa72ce0a066feae730c45e2888c67 Mon Sep 17 00:00:00 2001 From: tanshu Date: Mon, 2 Feb 2015 15:44:29 +0530 Subject: [PATCH] Fix: Added a 5 minute timeout for rebase --- brewman/views/Management/rebase.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/brewman/views/Management/rebase.py b/brewman/views/Management/rebase.py index 2120d4bf..d4353d06 100644 --- a/brewman/views/Management/rebase.py +++ b/brewman/views/Management/rebase.py @@ -21,6 +21,7 @@ __author__ = 'tanshu' @view_config(request_method='POST', route_name='api_rebase', renderer='json', permission='Rebase') @TryCatchFunction def rebase(request): + DBSession.execute('SET statement_timeout TO 300000;') date = request.matchdict.get('date', None) date = datetime.datetime.strptime(date, '%d-%b-%Y') user_id = uuid.UUID(authenticated_userid(request)) @@ -36,6 +37,7 @@ def rebase(request): for i in voucher_b.inventories: DBSession.add(i) cleanup_lint(date, accounts, batches) + DBSession.execute('RESET statement_timeout;') transaction.commit() return {}