private async void create_gist(PackageTestResultMessage message) { this.Log().Info( () => "Creating gist for Package: {0} Version: {1}. Result: {2}".format_with(message.PackageId, message.PackageVersion, message.Success ? "Pass" : "Fail")); var gistDescription = "{0} v{1} - {2} - Package Tests Results".format_with( message.PackageId, message.PackageVersion, message.Success ? "Passed" : "Failed"); try { var createdGistUrl = await _gistService.create_gist(gistDescription, isPublic : true, logs : message.Logs); //.ConfigureAwait(continueOnCapturedContext:false); EventManager.publish(new FinalPackageTestResultMessage(message.PackageId, message.PackageVersion, createdGistUrl.ToString(), message.Success)); } catch (Exception ex) { Bootstrap.handle_exception( new ApplicationException( "Error creating Gist for {0} v{1}, likely because Gists API is sometimes janky and throws more temper tantrums than a 2 year old. The service will try to test the package again later. Until then enjoy this error log heartbeat. The service is still running, yay!" .format_with(message.PackageId, message.PackageVersion), ex)); } }
private async void create_gist(PackageTestResultMessage message) { this.Log().Info( () => "Creating gist for Package: {0} Version: {1}. Result: {2}".format_with(message.PackageId, message.PackageVersion, message.Success ? "Pass" : "Fail")); var gistDescription = "{0} v{1} - {2} - Package Tests Results".format_with( message.PackageId, message.PackageVersion, message.Success ? "Passed" : "Failed"); try { var createdGistUrl = await _gistService.create_gist(gistDescription, isPublic: true, logs: message.Logs); //.ConfigureAwait(continueOnCapturedContext:false); EventManager.publish(new FinalPackageTestResultMessage(message.PackageId, message.PackageVersion, createdGistUrl.ToString(), message.Success)); } catch (Exception ex) { Bootstrap.handle_exception( new ApplicationException( "Error creating Gist for {0} v{1}, likely because Gists API is sometimes janky and throws more temper tantrums than a 2 year old. The service will try to test the package again later. Until then enjoy this error log heartbeat. The service is still running, yay!" .format_with(message.PackageId, message.PackageVersion), ex)); } }