@@ -160,6 +160,11 @@ Release Technical Solutions Centre
160
160
*/
161
161
#endregion
162
162
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
+
163
168
private static bool SubmitJob ( string unsignedDirectory , string signedDirectory )
164
169
{
165
170
// 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)
170
175
try
171
176
{
172
177
//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 ) ;
176
179
177
180
// Sets the Partial return flag option.
178
181
// 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)
253
256
JobWatcher jw = new JobWatcher ( ) ;
254
257
if ( ! fakeSign )
255
258
{
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
+ }
261
267
}
262
268
263
269
// Now we're done, so display any errors or warnings (in case we are in non-event mode)
0 commit comments