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

Conversation

@StanleyGoldman
Copy link
Contributor

@StanleyGoldman StanleyGoldman commented Nov 13, 2017

As mentioned in #409

We want to start using the Invalidated events on cache objects to know when we need to re-populate data.

For some of those cache objects, we want to fire an implicit invalidated on the application's "First Run" as opposed to a domain reload. That way we know these objects need to be populated immediately.

This change adds:

  • functionality to track the first run time in ApplicationCache
  • functionality to track when ManagedCacheBase objects are initialized
  • functionality in ManagedCacheBase.ValidateData() to verify if cache objects were initialized after application first run time, otherwise it will update and fire an "Invalidated" event
  • functionality to define which cache objects are invalid on first tun

This provides base functionality to:

Depends on:

Copy link
Contributor

@jcansdale jcansdale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to leave an inline-comment, but was denied. I'll paste it here instead:

image

}
set
{
InitializedAtString = value.ToString();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these DateTimeOffset.ToString() calls need to specify the ISO 8016 format, eg. 2017-11-16T20:24:46+00:00. As it is, they're outputting strings in whatever local configuration the system has, which may not be parseable by Parse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally fixed in #457 carried over here

@StanleyGoldman
Copy link
Contributor Author

@jcansdale Unity cannot serialize DateTimeOffset objects, but it will serialize string objects. So for all these dates we have a string field and a DateTimeOffset? field; the latter of which we populate lazily. I did however make a change based on your comment, there was no reason to set the lazily generated value to null and thus wait for the lazy generation.

Ensure FirstRun is resolved before FirstRunAt is called
@drguthals
Copy link

Seems straight forward and like a clean approach.

@StanleyGoldman StanleyGoldman merged commit ca56968 into master Nov 20, 2017
@StanleyGoldman StanleyGoldman deleted the enhancements/using-cache-invalidated-events branch November 20, 2017 23:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants