throttle contracts too

This commit is contained in:
Jonathan Rainville 2018-05-15 15:41:24 -04:00
parent 8cee44cbd7
commit 38cf7a4aa8

View File

@ -224,22 +224,22 @@ class Engine {
});
this.events.on('file-event', function (fileType) {
// TODO: still need to redeploy contracts because the original contracts
// config is being corrupted
if (fileType === 'asset') {
// Throttle file changes so we re-write only once for all files
clearTimeout(self.fileTimeout);
self.fileTimeout = setTimeout(() => {
clearTimeout(self.fileTimeout);
self.fileTimeout = setTimeout(() => {
// TODO: still need to redeploy contracts because the original contracts
// config is being corrupted
if (fileType === 'asset') {
// Throttle file changes so we re-write only once for all files
self.events.emit('asset-changed', self.contractsManager);
}, 50);
}
// TODO: for now need to deploy on asset changes as well
// because the contractsManager config is corrupted after a deploy
if (fileType === 'contract' || fileType === 'config') {
self.config.reloadConfig();
self.deployManager.deployContracts(function () {
});
}
}
// TODO: for now need to deploy on asset changes as well
// because the contractsManager config is corrupted after a deploy
if (fileType === 'contract' || fileType === 'config') {
self.config.reloadConfig();
self.deployManager.deployContracts(function () {
});
}
}, 50);
});
}