It would be nice to have some kind of modx module to set CRON-like tasks, I am thinking automatically purge the logs or clear the cache at given intervals for example.
Anyone has ideas has to formulate this request better or provide other applications, shoot !
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
-
MODX Staff
- 10,725 Posts
Both message-based triggering and true cron polling can be accomplished with the new Message Registry that is part of Revolution, though true polling with PHP requires a command-line PHP process to run in the background on your server at all times. This will of course not be possible in shared server situations and in general, PHP is not a good choice for such persistent server processes. Nevertheless, it is possible.
I’ll try and find some time to demonstrate this use of the Message Registry, but I’ve tested them in some situations to trigger indexing of content with an external search engine with great success. Basically, you send a message to the registry using a plugin or snippet, and have another plugin or snippet look for new messages and take action if one is found. The API is very simple and you can provide custom Register implementations to store messages to a database, ApacheMQ or another enterprise message queue, or anywhere else you can dream up. It comes with a default modFileRegister implementation that simply stores the messages to files in the cache directory.
Thanks Jason very cool
I run a dedicated which means those doors won’t be closed to me
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
or another enterprise message queue
Very interesting OpenGeek, I’m currently looking at the AMQP packages now shipping with RHEL and clones as a replacement for some old IBM MQ series stuff
one of our customers uses, an API to allow MODx to talk to AMQP would be great, sounds as though most of the work here is done in revo, I’ll have look ath this time permitting.
Use MODx, or the cat gets it!
Hey thanks a LOT GaneshXL !
Very nice
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
That is a good tip (I have it bookmarked from a previous post). However, one thing concerns me, if you clear the logs daily then you really don’t benefit from having the logs in the first place. Any parser errors will be lost and you will not know to fix them. And also if your sites gets ’invaded’ you will not know which user erased the critical document. I wuld rather only parse the database if it has more than X number of rows to make sure I keep the most recent activity.
The script deletes entries older than $days days (default 30).
MODx snippet-glossary 101:
Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
-
☆ A M B ☆
- 711 Posts
Just seen this on twitter and it looks pretty neat.
Last week we had a few client databases which were huge because the log tables were not cleaned out for so long.
Aaron