Skip to content

Commit

Permalink
Update monitor state timestamp when dataplicity or orcasite data changes
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Thaler <[email protected]>
  • Loading branch information
dthaler committed Sep 20, 2024
1 parent 74ff43a commit 3a4e1f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions OrcanodeMonitor/Core/Fetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ public async static Task UpdateOrcaHelloDataAsync(OrcanodeMonitorContext context
}
}

MonitorState.GetFrom(context).LastUpdatedTimestampUtc = DateTime.UtcNow;
await context.SaveChangesAsync();
}
catch (Exception ex)
Expand Down Expand Up @@ -569,6 +570,7 @@ public async static Task UpdateOrcasoundDataAsync(OrcanodeMonitorContext context
}
}

MonitorState.GetFrom(context).LastUpdatedTimestampUtc = DateTime.UtcNow;
await context.SaveChangesAsync();
}
catch (Exception ex)
Expand Down
9 changes: 7 additions & 2 deletions OrcanodeMonitor/Models/Orcanode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,13 @@ public Orcanode()
// for more information. For example, if adding a field called FooBar, then
// from Package Manager Console do:
// * Add-Migration AddFooBar
// When ready to deploy to an Azure SQL database, do from a developer command shell:
// * dotnet ef database update --connection "Server=tcp:orcasound-server.database.windows.net,1433;Initial Catalog=OrcasoundFreeDatabase;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;Authentication=\"Active Directory Default\";Pooling=False;"
//
// When ready to deploy to an Azure SQL database:
// 1. Stop the remote service.
// 2. Apply the migration from a developer command shell:
// dotnet ef database update --connection "Server=tcp:orcasound-server.database.windows.net,1433;Initial Catalog=OrcasoundFreeDatabase;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;Authentication=\"Active Directory Default\";Pooling=False;"
// 3. Publish from Visual Studio using the appropriate publish profile.
// 4. Start the remote service.

/// <summary>
/// Database key field. This is NOT the dataplicity serial GUID, since a node might first be
Expand Down

0 comments on commit 3a4e1f2

Please sign in to comment.