@@ -160,6 +160,11 @@ Release Technical Solutions Centre
160160 */
161161 #endregion
162162
163+ //"Codesign" represents the server - static variable do not change
164+ //9556 represents the port - constant value do not change
165+ const string RelayServer = "codesign.gtm.microsoft.com" ;
166+ const int RelayPort = 9556 ;
167+
163168 private static bool SubmitJob ( string unsignedDirectory , string signedDirectory )
164169 {
165170 // use env var so it is dynamic for the machine running this build to help prevent
@@ -170,9 +175,7 @@ private static bool SubmitJob(string unsignedDirectory, string signedDirectory)
170175 try
171176 {
172177 //Initialize the Codesign.Submitter object
173- //"Codesign" represents the server - static variable do not change
174- //9556 represents the port - constant value do not change
175- job = CODESIGN . Submitter . Job . Initialize ( "codesign.gtm.microsoft.com" , 9556 , true ) ;
178+ job = CODESIGN . Submitter . Job . Initialize ( RelayServer , RelayPort , true ) ;
176179
177180 // Sets the Partial return flag option.
178181 // False - If any files fail signing you will not get any files back.
@@ -253,11 +256,14 @@ private static bool SubmitJob(string unsignedDirectory, string signedDirectory)
253256 JobWatcher jw = new JobWatcher ( ) ;
254257 if ( ! fakeSign )
255258 {
256- // These calls optionally wait till the job is finished
257- // WARNING: this completely block execution for the specified timespan
258- int Milliseconds = - 1 ; // -1: wait forever
259- jw . Watch ( job , Milliseconds ) ;
260- //jw.Watch(job); // you can also call the Watch method this way and wait forever
259+ try
260+ {
261+ jw . Watch ( job . JobNumber , RelayServer , RelayPort , true ) ;
262+ }
263+ catch ( Exception ex )
264+ { // I hate general exceptions but the complete lack of documentation on the submitter leaves little choice and we need to ship...
265+ m_CallingTask . Log . LogWarning ( "Exception waiting for job - assuming job completed, subsequent steps may fail.\n Exeption: {0}" , ex ) ;
266+ }
261267 }
262268
263269 // Now we're done, so display any errors or warnings (in case we are in non-event mode)
0 commit comments