Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Event listener for expiring catalog contents in the future

Vote:
 

The customer expires catalog categories under Commerce. We are able to capture the event when the expiry datetime is set to “now” but if the user set expiration to a future date and that date comes, will episerver fire an event? 

#225222
Edited, Jul 09, 2020 4:31
Vote:
 

Hi, no event will be fired. I think you could listen to SavedContent/PublishedContent when expiry datetime is set to now, but there is no "expired" event (and I don't think that will ever be added, for obvious reasons) 

#225224
Jul 09, 2020 8:22
Vote:
 

What are the obvious reasons for this? We're currently have a main menu cache that contains categories and should be invalidated when a category has expired, so a new cache is built up without the expired category.

#225681
Jul 23, 2020 9:27
Vote:
 

If there is an "event" - like when you update/publish/delete a content, it would be easy to fire an event. For expiring you would need to have a service running 24/24 and notify when a content StopPublish time is passed. I would say it is a complex system and is (very) hard to implement.

#225683
Jul 23, 2020 9:54
Vote:
 

Whenever you set the expired date that is in the future, you store the date in a table along with the content id. A scheduled job ran ever 1 second checks if any of those dates has been passed and will fire an event? :)

#225690
Jul 23, 2020 10:39
Vote:
 

That is one way to do it - to be honest I think about the same thing as well. That can be used as a custom implementation, but as a framework level feature it will need a lot more considerations. 

#225691
Jul 23, 2020 10:51
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.