mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-02 10:25:21 +00:00
add queue for changes to do only one file build at the time
This commit is contained in:
parent
a35ce6f73e
commit
a3f8c809a0
@ -8,7 +8,8 @@ const CodeGenerator = require('../contracts/code_generator.js');
|
||||
const ServicesMonitor = require('./services_monitor.js');
|
||||
const Watch = require('../pipeline/watch.js');
|
||||
const LibraryManager = require('../versions/library_manager.js');
|
||||
let Pipeline = require('../pipeline/pipeline.js');
|
||||
const Pipeline = require('../pipeline/pipeline.js');
|
||||
const async = require('async');
|
||||
|
||||
class Engine {
|
||||
constructor(options) {
|
||||
@ -142,11 +143,17 @@ class Engine {
|
||||
normalizeInput: this.normalizeInput,
|
||||
plugins: this.plugins
|
||||
});
|
||||
|
||||
const queue = async.queue((task, callback) => {
|
||||
pipeline.build(task.abi, task.contractsJSON, task.path, callback);
|
||||
}, 1);
|
||||
|
||||
this.events.on('code-generator-ready', function () {
|
||||
self.events.request('code', function (abi, contractsJSON) {
|
||||
self.currentAbi = abi;
|
||||
self.contractsJSON = contractsJSON;
|
||||
pipeline.build(abi, contractsJSON, null, function() {
|
||||
|
||||
queue.push({abi, contractsJSON, path: null}, () => {
|
||||
if (self.watch) {
|
||||
self.watch.restart(); // Necessary because changing a file while it is writing can stop it from being watched
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user