Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfortescue committed Jul 8, 2020
1 parent a679186 commit dc335d5
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,11 @@ public static async Task Run([TimerTrigger("0 0 0 * * *")]TimerInfo myTimer, ILo
{
log.LogInformation($"INFO: Scoring {deploymentGroup?.Count() ?? -1} rollouts for repo '{deploymentGroup.Key}'");

// we're converting to Pacific Time because the GitHub API hates it when we do +0 as the offset
// this is an octokit bug
string timeZone = "Pacific Standard Time";
RolloutScorer.RolloutScorer rolloutScorer = new RolloutScorer.RolloutScorer
{
Repo = deploymentGroup.Key,
RolloutStartDate = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(deploymentGroup.First().Started.GetValueOrDefault(), timeZone),
RolloutEndDate = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTimeOffset.Now, timeZone),
RolloutStartDate = deploymentGroup.First().Started.GetValueOrDefault().ToOffset(TimeSpan.FromHours(-1)),
RolloutEndDate = DateTimeOffset.Now.ToOffset(TimeSpan.FromHours(-1)),
RolloutWeightConfig = Configs.DefaultConfig.RolloutWeightConfig,
GithubConfig = Configs.DefaultConfig.GithubConfig,
Log = log,
Expand Down

0 comments on commit dc335d5

Please sign in to comment.