cloudcms-server 3.2.328 → 3.2.330
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,13 +164,19 @@ exports = module.exports = function()
|
|
|
164
164
|
|
|
165
165
|
var VCSENTINEL_CACHE_KEY = "vcSentinelFailed-" + host;
|
|
166
166
|
|
|
167
|
+
console.log("[acquireGitanaJson] host: " + host + " - t1");
|
|
168
|
+
|
|
167
169
|
// so that only N number of virtual configs are loaded at a time
|
|
168
170
|
enqueueLoadVirtualConfig(function(host, rootStore, logMethod, callback) {
|
|
169
171
|
|
|
170
172
|
return function()
|
|
171
173
|
{
|
|
174
|
+
console.log("[acquireGitanaJson] host: " + host + " - t2");
|
|
175
|
+
|
|
172
176
|
rootStore.existsFile("gitana.json", function(exists) {
|
|
173
177
|
|
|
178
|
+
console.log("[acquireGitanaJson] host: " + host + " - t3, exists:" + exists);
|
|
179
|
+
|
|
174
180
|
var loadFromRemote = function(finishedLoading) {
|
|
175
181
|
|
|
176
182
|
// check cache to see if we already tried to load this in the past few minutes and were sorely disappointed
|
|
@@ -263,16 +269,23 @@ exports = module.exports = function()
|
|
|
263
269
|
|
|
264
270
|
if (exists)
|
|
265
271
|
{
|
|
272
|
+
console.log("[acquireGitanaJson] host: " + host + " - t4");
|
|
273
|
+
|
|
266
274
|
// read gitana json and send back
|
|
267
275
|
rootStore.readFile("gitana.json", function(err, data) {
|
|
268
276
|
|
|
269
277
|
if (err)
|
|
270
278
|
{
|
|
279
|
+
console.log("[acquireGitanaJson] host: " + host + " - t5");
|
|
271
280
|
return callback(err);
|
|
272
281
|
}
|
|
273
282
|
|
|
283
|
+
console.log("[acquireGitanaJson] host: " + host + " - t6: " + data);
|
|
284
|
+
|
|
274
285
|
if (!data)
|
|
275
286
|
{
|
|
287
|
+
console.log("[acquireGitanaJson] host: " + host + " - t7");
|
|
288
|
+
|
|
276
289
|
return callback({
|
|
277
290
|
"message": "The gitana.json data read from disk was null or empty"
|
|
278
291
|
})
|
|
@@ -283,12 +296,16 @@ exports = module.exports = function()
|
|
|
283
296
|
|
|
284
297
|
if (err)
|
|
285
298
|
{
|
|
299
|
+
console.log("[acquireGitanaJson] host: " + host + " - t8");
|
|
286
300
|
return callback(err);
|
|
287
301
|
}
|
|
288
302
|
|
|
303
|
+
console.log("[acquireGitanaJson] host: " + host + " - t9");
|
|
304
|
+
|
|
289
305
|
// if we failed to read stats or file size 0, then delete and call back with error
|
|
290
306
|
if (err || stats.size === 0)
|
|
291
307
|
{
|
|
308
|
+
console.log("[acquireGitanaJson] host: " + host + " - t10");
|
|
292
309
|
return rootStore.deleteFile("gitana.json", function() {
|
|
293
310
|
callback({
|
|
294
311
|
"message": "There was a problem writing the driver configuration file. Please reload."
|
|
@@ -296,6 +313,8 @@ exports = module.exports = function()
|
|
|
296
313
|
});
|
|
297
314
|
}
|
|
298
315
|
|
|
316
|
+
console.log("[acquireGitanaJson] host: " + host + " - t11");
|
|
317
|
+
|
|
299
318
|
// remove vcSentinel if it exists
|
|
300
319
|
process.cache.remove(VCSENTINEL_CACHE_KEY);
|
|
301
320
|
|
|
@@ -318,6 +337,8 @@ exports = module.exports = function()
|
|
|
318
337
|
}
|
|
319
338
|
}
|
|
320
339
|
|
|
340
|
+
console.log("[acquireGitanaJson] host: " + host + " - t20: " + JSON.stringify(gitanaJson, null, 2));
|
|
341
|
+
|
|
321
342
|
// otherwise, fine!
|
|
322
343
|
callback(null, gitanaJson);
|
|
323
344
|
});
|
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
|
-
|
|
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(workFn) {
|
|
@@ -50,7 +50,7 @@ module.exports = function(maxSize)
|
|
|
50
50
|
// decrement active count
|
|
51
51
|
activeCount--;
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
console.log("Active work items: " + activeCount);
|
|
54
54
|
|
|
55
55
|
// process more work on timeout
|
|
56
56
|
window.setTimeout(processWork);
|
|
@@ -71,6 +71,8 @@ module.exports = function(maxSize)
|
|
|
71
71
|
return function(workFn) {
|
|
72
72
|
pendingWorkFns.push(workFn);
|
|
73
73
|
|
|
74
|
+
console.log("PENDING WORK FUNCTIONS: " + pendingWorkFns.length);
|
|
75
|
+
|
|
74
76
|
// execute on timeout
|
|
75
77
|
window.setTimeout(processWork);
|
|
76
78
|
};
|