mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-02 18:34:09 +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 ServicesMonitor = require('./services_monitor.js');
|
||||||
const Watch = require('../pipeline/watch.js');
|
const Watch = require('../pipeline/watch.js');
|
||||||
const LibraryManager = require('../versions/library_manager.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 {
|
class Engine {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
@ -142,11 +143,17 @@ class Engine {
|
|||||||
normalizeInput: this.normalizeInput,
|
normalizeInput: this.normalizeInput,
|
||||||
plugins: this.plugins
|
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 () {
|
this.events.on('code-generator-ready', function () {
|
||||||
self.events.request('code', function (abi, contractsJSON) {
|
self.events.request('code', function (abi, contractsJSON) {
|
||||||
self.currentAbi = abi;
|
self.currentAbi = abi;
|
||||||
self.contractsJSON = contractsJSON;
|
self.contractsJSON = contractsJSON;
|
||||||
pipeline.build(abi, contractsJSON, null, function() {
|
|
||||||
|
queue.push({abi, contractsJSON, path: null}, () => {
|
||||||
if (self.watch) {
|
if (self.watch) {
|
||||||
self.watch.restart(); // Necessary because changing a file while it is writing can stop it from being watched
|
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