Run hook while storage is still locked
This commit is contained in:
parent
0f6e98a512
commit
65af0592d3
@ -372,14 +372,14 @@ class Application:
|
|||||||
"""Lock the collection with ``permission`` and execute hook."""
|
"""Lock the collection with ``permission`` and execute hook."""
|
||||||
with self.Collection.acquire_lock(lock_mode) as value:
|
with self.Collection.acquire_lock(lock_mode) as value:
|
||||||
yield value
|
yield value
|
||||||
hook = self.configuration.get("storage", "hook")
|
hook = self.configuration.get("storage", "hook")
|
||||||
if lock_mode == "w" and hook:
|
if lock_mode == "w" and hook:
|
||||||
self.logger.debug("Running hook")
|
self.logger.debug("Running hook")
|
||||||
folder = os.path.expanduser(self.configuration.get(
|
folder = os.path.expanduser(self.configuration.get(
|
||||||
"storage", "filesystem_folder"))
|
"storage", "filesystem_folder"))
|
||||||
subprocess.check_call(
|
subprocess.check_call(
|
||||||
hook % {"user": shlex.quote(user or "Anonymous")},
|
hook % {"user": shlex.quote(user or "Anonymous")},
|
||||||
shell=True, cwd=folder)
|
shell=True, cwd=folder)
|
||||||
|
|
||||||
def do_DELETE(self, environ, path, content, user):
|
def do_DELETE(self, environ, path, content, user):
|
||||||
"""Manage DELETE request."""
|
"""Manage DELETE request."""
|
||||||
|
Loading…
Reference in New Issue
Block a user