Skip to content

Commit

Permalink
Merge pull request #27518 from vespa-engine/olaa/dont-hardcode-date
Browse files Browse the repository at this point in the history
Remove hardcoded datetime
  • Loading branch information
ldalves authored Jun 26, 2023
2 parents 7e1c15d + f04a882 commit 3a06610
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import com.yahoo.yolean.Exceptions;

import java.io.IOException;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
Expand All @@ -36,6 +38,7 @@ public class ChangeManagementApiHandler extends AuditLoggingRequestHandler {

private final ChangeManagementAssessor assessor;
private final Controller controller;
private static final DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE_TIME.withZone(ZoneOffset.UTC);

public ChangeManagementApiHandler(ThreadedHttpRequestHandler.Context ctx, Controller controller) {
super(ctx, controller.auditLogger());
Expand Down Expand Up @@ -164,7 +167,7 @@ private HttpResponse doAssessment(List<String> hostNames) {
Cursor assessmentCursor = root.setObject("assessment");

// Updated gives clue to if the assessment is old
assessmentCursor.setString("updated", "2021-03-12:12:12:12Z");
assessmentCursor.setString("updated", formatter.format(controller.clock().instant()));

// Assessment on the cluster level
Cursor clustersCursor = assessmentCursor.setArray("clusters");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"assessment": {
"updated": "2021-03-12:12:12:12Z",
"updated": "2020-09-13T12:26:40Z",
"clusters": [
{
"app": "mytenant:myapp:default",
Expand Down

0 comments on commit 3a06610

Please sign in to comment.