[CDB] Cron Status

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Anti-Spam Guide
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
LavIgor
Registered User
Posts: 545
Joined: Mon Apr 28, 2014 1:47 pm

[CDB] Cron Status

Post by LavIgor »

Cron Status

Image

Authors: John P, LavIgor

Extension Description: This extension allows you to see the status of Cron and Cron tasks and to run ready Cron tasks.

Extension Version: 3.1.0-RC3

Requirements: phpBB 3.1.*@dev (RC3 version for Cron Status Notice)

Features:
- A special page for displaying Cron Status.
- Cron Status Notice on the main ACP page if Cron is locked.
- Ability to see last task dates, new task dates and to run ready tasks.
- Cron Status page is refreshed with Ajax every 60 seconds.
- Cron task that locked Cron and Cron tasks that have never run are marked with red color.
- The chosen order of Cron Jobs in the table is saved in configuration.

GitHub repository: https://github.com/BoardTools/cronstatus
Extension Download: https://github.com/BoardTools/cronstatu ... master.zip

Screenshots:
Cron_Status_1.png
Cron_Status_1.png (212.74 KiB) Viewed 2182 times
Cron_Status_2.png
Cron_Status_2.png (39.25 KiB) Viewed 2182 times
Last edited by LavIgor on Mon Aug 25, 2014 3:37 pm, edited 2 times in total.

User avatar
david63
Registered User
Posts: 17243
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [RC] Cron Status

Post by david63 »

This is one of the most useful tools that I have seen in a long time - thanks guys.

I will admit that I don't know the cron system but when it displays a list of jobs that are ready to run is it possible to show the priority that these jobs will be run - or is it just a matter that they run in time order, in which case could that be set as the default display order?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

LavIgor
Registered User
Posts: 545
Joined: Mon Apr 28, 2014 1:47 pm

Re: [RC] Cron Status

Post by LavIgor »

david63 wrote:I will admit that I don't know the cron system but when it displays a list of jobs that are ready to run is it possible to show the priority that these jobs will be run - or is it just a matter that they run in time order, in which case could that be set as the default display order?
Yes, cron jobs run in time order.
You can sort cron jobs in the table as you like by clicking on small arrows in its header. ;)

I'll think about the default priority today.

nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 546
Joined: Sun Apr 13, 2014 1:47 am
Location: Grenoble - France

Re: [RC] Cron Status

Post by nicofuma »

Just to say, if you have access to the console phpbbcli.php cron:list should give the same information (and with phpbbcli.php cron:run you are able to run the task you want or all of them).
Member of phpBB Development-Team
No Support via PM

LavIgor
Registered User
Posts: 545
Joined: Mon Apr 28, 2014 1:47 pm

Re: [RC] Cron Status

Post by LavIgor »

nicofuma wrote:Just to say, if you have access to the console phpbbcli.php cron:list should give the same information (and with phpbbcli.php cron:run you are able to run the task you want or all of them).
We have made this extension exactly because real boards often aren't provided with CLI access. ;)
Moreover, we've made additional features for task dates and worked the design - that can't be seen in CLI.

User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

Re: [RC] Cron Status

Post by John P »

Cron jobs runs in order how they are defined in cron_task.yml in config folder

Time is telling if they should run.

So, if all cronjobs should run they will run as they appear in cron_task.yml
The sorting in Cron Status is only visual.
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

User avatar
david63
Registered User
Posts: 17243
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [RC] Cron Status

Post by david63 »

But, as far as I can see, cron_task.yml does not include any cron jobs installed via extensions - so where do they come in the order?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 546
Joined: Sun Apr 13, 2014 1:47 am
Location: Grenoble - France

Re: [RC] Cron Status

Post by nicofuma »

The order is neither predetermined nor determinist. It depends on a lot of factor and can't be controlled, it's just a random order.
Member of phpBB Development-Team
No Support via PM

LavIgor
Registered User
Posts: 545
Joined: Mon Apr 28, 2014 1:47 pm

Re: [RC] Cron Status

Post by LavIgor »

The extension is updated.
Now we jumped to a new repository and made some changes.

- Namespaces now don't have underscores.
- The chosen order of Cron Jobs in the table is now saved in configuration - thanks to david63.

User avatar
david63
Registered User
Posts: 17243
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [RC] Cron Status

Post by david63 »

Just noticed something strange.

If there is an option to run a job and you click on that then the refresh counter goes to 10, no matter what it was on before.

Is it possible to add the ability to clear a "Cron lock"?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

Re: [RC] Cron Status

Post by John P »

The timer goes to 10 because we think it should be the max time for the cron job and then refresh the page. Why wait 60 seconds in this situation?

Sure it's possible the clear the cron lock but it automatically clears after one hour. Clearing cron lock while a cron is still running isn't a good way.
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

User avatar
david63
Registered User
Posts: 17243
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [RC] Cron Status

Post by david63 »

John P wrote:The timer goes to 10 because we think it should be the max time for the cron job and then refresh the page. Why wait 60 seconds in this situation?

Sure it's possible the clear the cron lock but it automatically clears after one hour. Clearing cron lock while a cron is still running isn't a good way.
10 seconds may not be long enough for extensions such as Auto Backup.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

Re: [RC] Cron Status

Post by John P »

That can be, Board Statistics uses 15 seconds, it's just a assumption.
In that case you will see the cron job Is moved after 70 seconds from the list.
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

User avatar
david63
Registered User
Posts: 17243
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [RC] Cron Status

Post by david63 »

John P wrote:That can be, Board Statistics uses 15 seconds, it's just a assumption.
In that case you will see the cron job Is moved after 70 seconds from the list.
Not convinced that that is correct for all cron jobs.

I have Auto Backup enabled and it takes well over ten seconds to run. As it hadn't run on my local test site I clicked on run. The refresh counter went to 10 seconds and when it refreshed the cron job was locked - and it is still locked ten minutes later (as I type this)

I agree that it is not a problem with the quick running cron jobs but having a situation when the cron is locked for an hour so that no other jobs can run is not, in my opinion, acceptable
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

Re: [RC] Cron Status

Post by John P »

Hi David,

A cron job, whenever it starts, takes the time it needs. phpBB locks so no other cron job can run in that time. When this cron job finishes it releases the lock so another cron job can run.

If there is no release because of a faulty script or whatever, phpBB assumes after one hour the cron job crashed and releases it. The developers of phpBB designed it this way.
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

Locked

Return to “Extensions in Development”