Message Boards
Web Content Articles expire long before their expiration date
Juan Miguel Leal Aragón, modified 4 Years ago.
Web Content Articles expire long before their expiration date
Junior Member Posts: 27 Join Date: 10/24/17 Recent Posts
1. Create a Basic Web Content
2. Set the expiration date to 2 hours in the future
3. Wait 15 minutes
4. Assert the article is expired
Why this happen? always expired before expiratdion Date. I saw the job and this execute checkArticles in JournalArticleLocalServicesImpl and the selecte for check the articles is :
<![CDATA[
SELECT
{JournalArticle.*}
FROM
JournalArticle
WHERE
(classNameId = ?) AND
([$STATUS$]) AND
(expirationDate <= ?)
]]>
wheren ? by expirationDate is now + 24 hours, so i don´t understand because change status content to expired (3)
Thanks in advanced.
2. Set the expiration date to 2 hours in the future
3. Wait 15 minutes
4. Assert the article is expired
Why this happen? always expired before expiratdion Date. I saw the job and this execute checkArticles in JournalArticleLocalServicesImpl and the selecte for check the articles is :
<![CDATA[
SELECT
{JournalArticle.*}
FROM
JournalArticle
WHERE
(classNameId = ?) AND
([$STATUS$]) AND
(expirationDate <= ?)
]]>
wheren ? by expirationDate is now + 24 hours, so i don´t understand because change status content to expired (3)
Thanks in advanced.
Olaf Kock, modified 4 Years ago.
RE: Web Content Articles expire long before their expiration date
Liferay Legend Posts: 6396 Join Date: 9/23/08 Recent PostsJuan Miguel Leal Aragón:
My first guess is a mismatch between your server's timezone and what you've configured for Liferay. Check if there is a correlation between the difference of your timezone to UTC and the mismatched expiration time. Or just validate that your server runs on the timezone that Liferay assumes (one possibility to set it is in setenv.bat on tomcat. Maybe it's even in Liferay's configuration where you configure the default timezone. So even if the current time appears correct, you might have a mismatch between the actual expiration time (with timezone) and what Liferay assumes.
1. Create a Basic Web Content
2. Set the expiration date to 2 hours in the future
3. Wait 15 minutes
4. Assert the article is expired
Why this happen?
Could also be your current user's timezone, if you recently moved between timezones and have confiured your user account to assume everything to be in "local" time (for a different "local" than where you are right now)
Juan Miguel Leal Aragón, modified 4 Years ago.
RE: Web Content Articles expire long before their expiration date
Junior Member Posts: 27 Join Date: 10/24/17 Recent Posts
Hello Olaf Kock
Thanks by your response. I review all things that you say and all is correct (timezone in server, liferay and timezone user liferay).
I review the code checkArticlesByExpirationDate in JournalArticleLocalServicesImpl and i regard this:
The parameter expirationDate is always currenta time (new Date(now)) and if you see, this is incresase 24 hours (Why?). If you increase this date, in the previous select, always expiration date of article is before if you want that a article expired un few hours.
Other things that don´t work is the property journal.article.check.interval , I try put 1 minute but never work.
Simply, I want understand the behavior of shedule job for check articles and especially I know because I put a expiration date at today at 15:00 and after 15 minutes , this article is expired. This behavior is not logic.
Thanks in advance.
Juanmi
Thanks by your response. I review all things that you say and all is correct (timezone in server, liferay and timezone user liferay).
I review the code checkArticlesByExpirationDate in JournalArticleLocalServicesImpl and i regard this:
The parameter expirationDate is always currenta time (new Date(now)) and if you see, this is incresase 24 hours (Why?). If you increase this date, in the previous select, always expiration date of article is before if you want that a article expired un few hours.
Other things that don´t work is the property journal.article.check.interval , I try put 1 minute but never work.
Simply, I want understand the behavior of shedule job for check articles and especially I know because I put a expiration date at today at 15:00 and after 15 minutes , this article is expired. This behavior is not logic.
Thanks in advance.
Juanmi
Jürgen Kappler, modified 4 Years ago.
RE: Web Content Articles expire long before their expiration date
New Member Posts: 6 Join Date: 1/30/15 Recent Posts
Hi Juan Miguel, may I ask what version of Liferay you are using?
First, the journal.article.check.interval, was deprecated in 7.1. To change this you would have to go to system settings, and you would have to change it there. So that's why it might not be working for you.
Also, the logic for expiring articles have changed a bit in 7.2 (since now it's indexed by company), but normally, it would check for:
expirationDate.getTime() + checkInterval so as to also include the checkInterval (which is 15m by default in 7.2)
I can give you more information if you provide us the version you are using. Hope that what I mentioned helps.
Thanks
First, the journal.article.check.interval, was deprecated in 7.1. To change this you would have to go to system settings, and you would have to change it there. So that's why it might not be working for you.
Also, the logic for expiring articles have changed a bit in 7.2 (since now it's indexed by company), but normally, it would check for:
expirationDate.getTime() + checkInterval so as to also include the checkInterval (which is 15m by default in 7.2)
I can give you more information if you provide us the version you are using. Hope that what I mentioned helps.
Thanks
Juan Miguel Leal Aragón, modified 4 Years ago.
RE: Web Content Articles expire long before their expiration date
Junior Member Posts: 27 Join Date: 10/24/17 Recent Posts
Hi Jürgen,
Thanks a lot for your response, my version of liferay is liferay-ce-portal-7.0-ga5
Thanks in advance.Juanmi
Thanks a lot for your response, my version of liferay is liferay-ce-portal-7.0-ga5
Thanks in advance.Juanmi