I set up a variable:
Code: Select all
private System.Threading.Timer _timer2;
Code: Select all
_timer2 = new System.Threading.Timer(new System.Threading.TimerCallback(TimedEvent), null, 60000, 60000);
Code: Select all
private void TimedEvent(Object stateInfo)
{
// THIS IS RUNNING ON ITS OWN THREAD, OUTSIDE OF HTTPCONTEXT
// (HTTPCONTEXT.CONTEXT IS NULL)
// YOU MUST INITIALIZE THE TOKEN FOR THE STORE, CHANGE THE ID IF IT IS OTHER THAN 1
Store store = StoreDataSource.Load(1);
// INITIALIZE THE TOKEN FOR THIS STORE
// Token.Instance.InitStoreContext(store);
AbleContext.Current.Store = store;
// *********
// PUT YOUR CODE BELOW THIS COMMENT
// *********
Logger.Info("Timed task is running...");
// *********
// PUT YOUR CODE ABOVE THIS COMMENT
// *********
// RESET THE TOKEN INSTANCE AFTER THE EVENT RUNS
// Token.ResetInstance();
AbleContext.Current.Store = null;
}
1. Did I modify the code correctly for Gold?
2. What else do I need to do to get this to work?