mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Don't take lock for read/GET operations : also cover cases when there's a list of routes
This commit is contained in:
parent
ac0ac24996
commit
1e79e99cc8
1 changed files with 4 additions and 2 deletions
|
@ -666,7 +666,8 @@ class ActionsMap:
|
|||
|
||||
# Disable the locking mechanism for all actions that are 'GET' actions on the api
|
||||
routes = action_options.get("api")
|
||||
if routes and isinstance(routes, str) and routes.startswith("GET "):
|
||||
routes = [routes] if isinstance(routes, str) else routes
|
||||
if routes and all(route.startswith("GET ") for route in routes):
|
||||
action_parser.want_to_take_lock = False
|
||||
else:
|
||||
action_parser.want_to_take_lock = True
|
||||
|
@ -716,7 +717,8 @@ class ActionsMap:
|
|||
|
||||
# Disable the locking mechanism for all actions that are 'GET' actions on the api
|
||||
routes = action_options.get("api")
|
||||
if routes and isinstance(routes, str) and routes.startswith("GET "):
|
||||
routes = [routes] if isinstance(routes, str) else routes
|
||||
if routes and all(route.startswith("GET ") for route in routes):
|
||||
action_parser.want_to_take_lock = False
|
||||
else:
|
||||
action_parser.want_to_take_lock = True
|
||||
|
|
Loading…
Add table
Reference in a new issue