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