cloudcms-server 3.2.335 → 3.2.336
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -164,19 +164,13 @@ exports = module.exports = function()
|
|
|
164
164
|
|
|
165
165
|
var VCSENTINEL_CACHE_KEY = "vcSentinelFailed-" + host;
|
|
166
166
|
|
|
167
|
-
console.log("[acquireGitanaJson] host: " + host + " - t1");
|
|
168
|
-
|
|
169
167
|
// so that only N number of virtual configs are loaded at a time
|
|
170
168
|
var workFn = function(host, rootStore, logMethod) {
|
|
171
169
|
|
|
172
170
|
return function(done)
|
|
173
171
|
{
|
|
174
|
-
console.log("[acquireGitanaJson] host: " + host + " - t2");
|
|
175
|
-
|
|
176
172
|
rootStore.existsFile("gitana.json", function(exists) {
|
|
177
173
|
|
|
178
|
-
console.log("[acquireGitanaJson] host: " + host + " - t3, exists:" + exists);
|
|
179
|
-
|
|
180
174
|
var loadFromRemote = function(finishedLoading) {
|
|
181
175
|
|
|
182
176
|
// check cache to see if we already tried to load this in the past few minutes and were sorely disappointed
|
|
@@ -269,23 +263,16 @@ exports = module.exports = function()
|
|
|
269
263
|
|
|
270
264
|
if (exists)
|
|
271
265
|
{
|
|
272
|
-
console.log("[acquireGitanaJson] host: " + host + " - t4");
|
|
273
|
-
|
|
274
266
|
// read gitana json and send back
|
|
275
267
|
rootStore.readFile("gitana.json", function(err, data) {
|
|
276
268
|
|
|
277
269
|
if (err)
|
|
278
270
|
{
|
|
279
|
-
console.log("[acquireGitanaJson] host: " + host + " - t5");
|
|
280
271
|
return done(err);
|
|
281
272
|
}
|
|
282
273
|
|
|
283
|
-
console.log("[acquireGitanaJson] host: " + host + " - t6: " + data);
|
|
284
|
-
|
|
285
274
|
if (!data)
|
|
286
275
|
{
|
|
287
|
-
console.log("[acquireGitanaJson] host: " + host + " - t7");
|
|
288
|
-
|
|
289
276
|
return done({
|
|
290
277
|
"message": "The gitana.json data read from disk was null or empty"
|
|
291
278
|
})
|
|
@@ -296,16 +283,12 @@ exports = module.exports = function()
|
|
|
296
283
|
|
|
297
284
|
if (err)
|
|
298
285
|
{
|
|
299
|
-
console.log("[acquireGitanaJson] host: " + host + " - t8");
|
|
300
286
|
return done(err);
|
|
301
287
|
}
|
|
302
288
|
|
|
303
|
-
console.log("[acquireGitanaJson] host: " + host + " - t9");
|
|
304
|
-
|
|
305
289
|
// if we failed to read stats or file size 0, then delete and call back with error
|
|
306
290
|
if (err || stats.size === 0)
|
|
307
291
|
{
|
|
308
|
-
console.log("[acquireGitanaJson] host: " + host + " - t10");
|
|
309
292
|
return rootStore.deleteFile("gitana.json", function() {
|
|
310
293
|
done({
|
|
311
294
|
"message": "There was a problem writing the driver configuration file. Please reload."
|
|
@@ -313,8 +296,6 @@ exports = module.exports = function()
|
|
|
313
296
|
});
|
|
314
297
|
}
|
|
315
298
|
|
|
316
|
-
console.log("[acquireGitanaJson] host: " + host + " - t11");
|
|
317
|
-
|
|
318
299
|
// remove vcSentinel if it exists
|
|
319
300
|
process.cache.remove(VCSENTINEL_CACHE_KEY);
|
|
320
301
|
|
|
@@ -337,8 +318,6 @@ exports = module.exports = function()
|
|
|
337
318
|
}
|
|
338
319
|
}
|
|
339
320
|
|
|
340
|
-
console.log("[acquireGitanaJson] host: " + host + " - t20: " + JSON.stringify(gitanaJson, null, 2));
|
|
341
|
-
|
|
342
321
|
// otherwise, fine!
|
|
343
322
|
done(null, gitanaJson);
|
|
344
323
|
});
|
package/package.json
CHANGED
package/util/workqueue.js
CHANGED
|
@@ -40,7 +40,7 @@ module.exports = function(maxSize)
|
|
|
40
40
|
// increment active count
|
|
41
41
|
activeCount++;
|
|
42
42
|
|
|
43
|
-
console.log("Active work items: " + activeCount);
|
|
43
|
+
// console.log("Active work items: " + activeCount);
|
|
44
44
|
|
|
45
45
|
// define execution function and splice/bind to 0th element from pending list
|
|
46
46
|
var executionFn = function(work) {
|
|
@@ -48,18 +48,18 @@ module.exports = function(maxSize)
|
|
|
48
48
|
var workFn = work.workFn;
|
|
49
49
|
var callbackFn = work.callbackFn;
|
|
50
50
|
|
|
51
|
-
console.log("[WORKQUEUE - queue: " + pendingWorkQueue.length + ", actives: " + activeCount + "] start work");
|
|
51
|
+
// console.log("[WORKQUEUE - queue: " + pendingWorkQueue.length + ", actives: " + activeCount + "] start work");
|
|
52
52
|
|
|
53
53
|
workFn(function(err, obj1, obj2) {
|
|
54
54
|
|
|
55
55
|
// decrement active count
|
|
56
56
|
activeCount--;
|
|
57
57
|
|
|
58
|
-
console.log("[WORKQUEUE - queue: " + pendingWorkQueue.length + ", actives: " + activeCount + "] finish work");
|
|
58
|
+
// console.log("[WORKQUEUE - queue: " + pendingWorkQueue.length + ", actives: " + activeCount + "] finish work");
|
|
59
59
|
|
|
60
60
|
// fire optional callback
|
|
61
61
|
if (callbackFn) {
|
|
62
|
-
console.log("[WORKQUEUE - queue: " + pendingWorkQueue.length + ", actives: " + activeCount + "] fire work callback");
|
|
62
|
+
// console.log("[WORKQUEUE - queue: " + pendingWorkQueue.length + ", actives: " + activeCount + "] fire work callback");
|
|
63
63
|
window.setTimeout(function() {
|
|
64
64
|
callbackFn(err, obj1, obj2);
|
|
65
65
|
});
|
|
@@ -93,8 +93,6 @@ module.exports = function(maxSize)
|
|
|
93
93
|
|
|
94
94
|
pendingWorkQueue.push(pendingWork);
|
|
95
95
|
|
|
96
|
-
console.log("PENDING WORK FUNCTIONS: " + pendingWorkQueue.length);
|
|
97
|
-
|
|
98
96
|
// execute on timeout
|
|
99
97
|
window.setTimeout(processWork);
|
|
100
98
|
};
|