Commit 424483a1 authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

Include mtime in watch events.

parent 55e773f9
......@@ -477,6 +477,10 @@ class FileSystem(object):
with self._monitor_lock:
# inform all listener
if os.path.exists(event.watch.path):
mtime = os.path.getmtime(event.watch.path)
else:
mtime = -1
for combined_id in event.watch.listener:
vispa.remote.send_topic(
"extension.%s.socket.watch" % combined_id[1],
......@@ -484,11 +488,12 @@ class FileSystem(object):
data={
"path": event.watch.path,
"action_name": event.action_name,
"watch_id": combined_id[2]
"watch_id": combined_id[2],
"mtime": mtime
})
# cleanup yourself
if event.action_name == 'delete self':
if mtime == -1:
for combined_id in event.watch.listener:
del self._monitor_listener[combined_id]
self._check_watch(event.watch)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment