Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 747baec

Browse files
Invalid data is not valid until populated
1 parent a66bd28 commit 747baec

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/ApplicationCache.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,10 @@ private bool ValidateInitialized()
148148
var notInitialized = ApplicationCache.Instance.FirstRunAt > InitializedAt;
149149
if (notInitialized)
150150
{
151-
Logger.Trace("Initialized");
152-
InitializedAt = DateTimeOffset.Now;
153-
Save(true);
151+
Logger.Trace("Not Initialized");
154152

155153
if (invalidOnFirstRun)
156154
{
157-
Logger.Trace("FirstRun Invalidation");
158155
InvalidateData();
159156
}
160157
}
@@ -166,11 +163,15 @@ public void InvalidateData()
166163
{
167164
Logger.Trace("Invalidate");
168165
CacheInvalidated.SafeInvoke();
169-
SaveData(DateTimeOffset.Now, false);
170166
}
171167

172168
protected void SaveData(DateTimeOffset now, bool isUpdated)
173169
{
170+
if (InitializedAt == DateTimeOffset.MinValue)
171+
{
172+
InitializedAt = now;
173+
}
174+
174175
if (isUpdated)
175176
{
176177
LastUpdatedAt = now;

0 commit comments

Comments
 (0)