jenkins-bot has submitted this change and it was merged.

Change subject: Record which host picks up a job.
......................................................................


Record which host picks up a job.

Change-Id: Iace7353aabb3f350b03f643cfb4cbcb41ec7ea62
---
M lib/JobDetails.js
M lib/threads/backend.js
2 files changed, 14 insertions(+), 5 deletions(-)

Approvals:
  Arlolra: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/JobDetails.js b/lib/JobDetails.js
index 33fc4f0..c86801e 100644
--- a/lib/JobDetails.js
+++ b/lib/JobDetails.js
@@ -63,6 +63,12 @@
        this.status = new JobStatus();
 
        /**
+        * Host which is processing this job.
+        * @type {string}
+        */
+       this.host = null;
+
+       /**
         * URL that will accept a GET for the final file
         * @type {string}
         */
diff --git a/lib/threads/backend.js b/lib/threads/backend.js
index 3271acc..e17a0db 100644
--- a/lib/threads/backend.js
+++ b/lib/threads/backend.js
@@ -197,14 +197,17 @@
  * @returns {promise}
  */
 function newItemFromQueue( obj ) {
-       var jobDetails;
+       var jobDetails, host;
        var metabookFile, bundleFile, renderTempDir, renderedFile;
 
        jobDetails = jd.fromJson( obj );
+       host = jobDetails.host = config.coordinator.hostname || os.hostname();
+
        console.info(
-               'Backend worker now picking up job %s for writer %s',
-                       jobDetails.collectionId,
-                       jobDetails.writer,
+               'Backend worker on %s now picking up job %s for writer %s',
+               host,
+               jobDetails.collectionId,
+               jobDetails.writer,
                {
                        channel: 'backend',
                        job:     {
@@ -240,7 +243,7 @@
                        // We have something! Create the URL and update 
everyone!
                        var url = util.format(
                                
"http://%s:%s/?command=download&collection_id=%s&writer=%s";,
-                               config.coordinator.hostname || os.hostname(),
+                               host,
                                config.frontend.port || '80',
                                jobDetails.collectionId,
                                jobDetails.writer

-- 
To view, visit https://gerrit.wikimedia.org/r/177119
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iace7353aabb3f350b03f643cfb4cbcb41ec7ea62
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to