November Happy Hour will be moved to Thursday December 5th.

Content Expired Event

Vote:
 

Hello,

There is already a post for this question but it seems to be archived for new posts. Please refer to https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2017/8/content-expired-event/

Is there an event that runs when the content is expired or is expiring? I tested SavingContent but it does not get fired in this case. I am also not interested in scheduling/scheduled content since they run at the time when the page is marked with an expiration date, not at the time of the expiration date.

#201056
Feb 04, 2019 11:26
Vote:
 

There is no such event

#201064
Feb 04, 2019 12:42
Vote:
 

I see. Getting expired pages as descriped in this post is possible but running a job that controls this often (once every couple of minutes) does not feel right. https://world.episerver.com/forum/legacy-forums/Episerver-7-CMS/Thread-Container/2016/1/expired-page-event/ 

I wonder if there are any other approaches I can take for this problem. I need to run a specific function as soon as the page becomes expired.

#201066
Edited, Feb 04, 2019 13:40
Vote:
 

There is an Episerver scheduled job called 'Archive Function' that periodically runs based on its settings to perform the in-built archiving of expired pages. 

I think that for you to pick up expired pages, you would be able to fairly easily create a new job that does something similar, but instead of archiving it performs whatever action you need to do. Does that help?

#201078
Feb 05, 2019 0:36
Vote:
 

What do you need the expired event for? There is no change to the content at that point, it just the time in StopPublish value is passed. If you have fairly small amount of content then it might be OK to iterate over time. However, if you have a few thousands or more, then that's less than optimal.

#201080
Feb 05, 2019 10:12
Vote:
 

Marcus and Quan, thank you for your responses.

I saw somewhere on this forum that there is a stored procedure that selects archived pages. While in theory it is possible to run it as frequent as possible, it might not be the smartest option to act in such manner. I need to act within seconds after the page is archived if not immediately.

Quan, do you think iterating couple of hundred pages every minute would be optimal? 

#201149
Feb 07, 2019 8:38
Vote:
 

Not directly to the database. That wouldn't be good.

I'm pretty sure that this value will be available in the Find index... you could maybe use that?

#201150
Feb 07, 2019 8:39
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.