Commit 354ca4cc authored by Leo Iannacone's avatar Leo Iannacone

fire send only if a file is created or deleted (event is "rename")

parent 893466ec
......@@ -52,7 +52,8 @@ io.sockets.on('connection', function(socket) {
packages_path = path.join(config.debomatic_path, data.distribution.name, 'pool')
try {
watchIncomingPackages = fs.watch(packages_path, { persistent: true}, function(event, fileName) {
send.view(socket, data);
if (event == 'rename')
send.view(socket, data);
});
watchers.push(watchIncomingPackages);
} catch (err) {}
......@@ -61,7 +62,8 @@ io.sockets.on('connection', function(socket) {
pack_path = path.join(packages_path, data.package.name + '_' + data.package.version);
try {
watchPackageFiles = fs.watch(pack_path, {persistent: true}, function (event, filename) {
send.view(socket, data);
if (event == 'rename')
send.view(socket, data);
});
watchers.push(watchPackageFiles)
} catch (err) {}
......
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