Implement deferred core utility parity APIs/tests and refresh tracking artifacts

This commit is contained in:
Joseph Doherty
2026-02-27 10:27:05 -05:00
parent c0aaae9236
commit b94a67be6e
17 changed files with 842 additions and 9 deletions

View File

@@ -25,6 +25,18 @@ public static class AccessTimeService
// Mirror Go's init(): nothing to pre-allocate in .NET.
}
/// <summary>
/// Explicit init hook for Go parity.
/// Mirrors package <c>init()</c> in server/ats/ats.go.
/// This method is intentionally idempotent.
/// </summary>
public static void Init()
{
// Ensure a non-zero cached timestamp is present.
var now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() * 1_000_000L;
Interlocked.CompareExchange(ref _utime, now, 0);
}
/// <summary>
/// Registers a user. Starts the background timer when the first registrant calls this.
/// Each call to <see cref="Register"/> must be paired with a call to <see cref="Unregister"/>.