Last active
September 22, 2022 13:23
-
-
Save fnbk/46a239e477234a69a19f70a08af7ab96 to your computer and use it in GitHub Desktop.
dirty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async Task<Job> CreateJob(order order) | |
{ | |
Job job = new Job | |
{ | |
ActivationTime = order.ClientLocalStartTime, | |
ComputerName = order.ComputerName, | |
orderId = order.Id, | |
Status = "created" | |
}; | |
if (ValidateComputer(order, null, _serverSecret)) | |
{ | |
Computer computer = GetComputer(order.ComputerName, order.CustomerId); | |
string serverAddress = GetServerAddress(order.ComputerName, computer.CustomerId); | |
if (!string.IsNullOrWhiteSpace(serverAddress)) | |
{ | |
List<JobAction> actions = await CheckForReleaseAndCreateActionAsync(order, computer); | |
if (!actions.Any()) | |
{ | |
actions = await CheckForBundleAndCreateActionsAsync(order, computer); | |
} | |
if (!actions.Any()) | |
{ | |
actions = await CheckForCollectionAndCreateActionsAsync(order, computer); | |
} | |
if (!actions.Any()) | |
{ | |
actions = await CheckForApplicationAndCreateActionsAsync(order, computer); | |
} | |
foreach (JobAction action in actions) | |
{ | |
action.SiteServer = serverAddress; | |
} | |
job.JobActions = actions; | |
} | |
else | |
{ | |
job.Status = "Failed, site server not found."; | |
} | |
} | |
return job; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment