We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6726
    • 7,075 Posts
    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
      • 22303 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.
        • 6726
        • 7,075 Posts
        Thanks Jason very cool cool

        I run a dedicated which means those doors won’t be closed to me smiley
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 26903
          • 1,336 Posts
          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!
            • 6726
            • 7,075 Posts
            Hey thanks a LOT GaneshXL !

            Very nice grin
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 7231
              • 4,205 Posts
              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.
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don't know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 16034
                • 107 Posts
                The script deletes entries older than $days days (default 30).
                  MODx snippet-glossary 101:
                  Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
                  • 7231
                  • 4,205 Posts
                  Quote from: Kleist at Dec 04, 2008, 07:34 AM

                  The script deletes entries older than $days days (default 30).
                  Duhh, should have looked at the script again. I know it from here and it simply truncates in that version. undecided
                    [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                    Something is happening here, but you don't know what it is.
                    Do you, Mr. Jones? - [bob dylan]
                    • 37550 ☆ 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
                      http://www.onesmarthost.co.uk
                      UK MODX Hosting with love.