Skip to content

Commit

Permalink
Minor fix to logging with GetKey
Browse files Browse the repository at this point in the history
  • Loading branch information
artemlos committed Jan 14, 2022
1 parent 4eee8d2 commit 23ad3de
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions LicenseServer/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,20 @@ public static string ProcessActivateRequest(byte[] stream, Dictionary<LAKey, LAR
{
if(ts.Days >= cacheLength)
{
return $"Could not retrieve an updated license '{licenseKey}' and machine code '{machineCode}'.";
if(method == APIMethod.GetKey)
return $"Could not retrieve an updated license '{licenseKey}'.";
else
return $"Could not retrieve an updated license '{licenseKey}' and machine code '{machineCode}'.";

}
else if (attemptToRefresh)
{
ReturnResponse(result.Response, context);
return $"Retrieved cached version of the license '{licenseKey}' and machine code '{machineCode}'.";

if(method == APIMethod.GetKey)
return $"Retrieved cached version of the license '{licenseKey}'.";
else
return $"Retrieved cached version of the license '{licenseKey}' and machine code '{machineCode}'.";
}
}

Expand All @@ -170,13 +178,19 @@ public static string ProcessActivateRequest(byte[] stream, Dictionary<LAKey, LAR

keysToUpdate.AddOrUpdate(key, x => result.Response, (x, y) => result.Response);

return $"Cache updated for license '{licenseKey}' and machine code '{machineCode}'.";
if (method == APIMethod.GetKey)
return $"Cache updated for license '{licenseKey}'.";
else
return $"Cache updated for license '{licenseKey}' and machine code '{machineCode}'.";

}
else
{
ReturnResponse(result.Response, context);
return $"Retrieved cached version of the license '{licenseKey}' and machine code '{machineCode}'.";
if (method == APIMethod.GetKey)
return $"Retrieved cached version of the license '{licenseKey}'.";
else
return $"Retrieved cached version of the license '{licenseKey}' and machine code '{machineCode}'.";
}
}
else
Expand Down

0 comments on commit 23ad3de

Please sign in to comment.