Skip to content
Snippets Groups Projects
Commit 5f737188 authored by Manuela Kuhn's avatar Manuela Kuhn
Browse files

ZMQ only gets triggered by onModify Events

parent 5ed12fb4
No related branches found
No related tags found
No related merge requests found
...@@ -20,42 +20,42 @@ local formats = { jpg = true, tif = true, cbf = true, log = true } ...@@ -20,42 +20,42 @@ local formats = { jpg = true, tif = true, cbf = true, log = true }
local folders = { "/local", "/current/raw", "/commissioning/raw" } local folders = { "/local", "/current/raw", "/commissioning/raw" }
gpfs = { gpfs = {
maxProcesses = 50, -- maxProcesses = 50,
onCreate = function(event) -- onCreate = function(event)
-- check if in relevant subfolder -- -- check if in relevant subfolder
local location = false -- local location = false
for i, path in ipairs(folders) do -- for i, path in ipairs(folders) do
if string.sub(event.path, 1, string.len(path)) == path then -- if string.sub(event.path, 1, string.len(path)) == path then
location = true -- location = true
break -- break
end -- end
end -- end
if location == false then return end -- if location == false then return end
--
if event.isdir then -- if event.isdir then
for i, path in ipairs(folders) do -- for i, path in ipairs(folders) do
if path == event.pathname then return end -- if path == event.pathname then return end
end -- end
spawn( -- spawn(
event, -- event,
'/bin/mkdir', -- '/bin/mkdir',
event.targetPath -- event.targetPath
) -- )
else -- else
-- check filetype -- -- check filetype
local extension = string.match(event.name, ".*%.([^.]+)$") -- local extension = string.match(event.name, ".*%.([^.]+)$")
if formats[extension] ~= true then return end -- if formats[extension] ~= true then return end
--
spawn ( -- spawn (
event, -- event,
'/usr/bin/python', -- '/usr/bin/python',
'/space/projects/Live_Viewer/wrapper_script.py', -- '/space/projects/Live_Viewer/wrapper_script.py',
'--mv_source', -- '--mv_source',
event.sourcePath, -- event.sourcePath,
'--mv_target', -- '--mv_target',
event.targetPathdir -- event.targetPathdir
) -- )
-- spawn( -- spawn(
-- event, -- event,
...@@ -63,8 +63,8 @@ gpfs = { ...@@ -63,8 +63,8 @@ gpfs = {
-- event.sourcePath, -- event.sourcePath,
-- event.targetPathdir -- event.targetPathdir
-- ) -- )
end -- end
end, -- end,
onModify = function(event) onModify = function(event)
if event.isdir then if event.isdir then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment