Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Plugin that executes regularly

plugins

Started by Henry PRGRM 4 years ago · 1 replies · 701 views
4 years ago

Hey,
I've implemented a plugin that fetches game data from my own game database and "converts" these to Grav-Pages. So far so good, but the file_get_contents() function (using cURL makes no difference) takes really long until it's finished (30sec+) and I can't do anything to fix this (the problem is afaik the DNS of my shared webhost that I use).

Currently the plugin is attached to the "onPageInitialized" Event Hook and I tried it with "onShutdown" aswell, because I was hoping that the Page is already rendered and usable for the user. But that doesn't work either.

Actually I don't really need these event hooks, because it updates the data in the same moment, a user navigates to a "/games/xyz" page and as long as the user does not refresh the page, he won't see the changes. This behaviour is kind of weird and I was wondering if it's possible to define a plugin without an event hook that "calls itself" (not sure about the wording, but I hope you know what I mean) like once or twice per day?

WITHOUT using the Scheduler... because I can't add a user to the crontab with my shared host provider, I can just define some scheduled tasks within the admin panel of my shared host in a "html form" kind of.

I want the plugin structure, because I like the feature to configure the plugin.

Does someone has an idea? Thanks in advance.

Suggested topics

Topic Participants Replies Views Activity
Plugins · by renedebaaij, 2 days ago
0 33 2 days ago
Plugins · by complanar, 3 weeks ago
6 385 2 weeks ago
Plugins · by BenLaKnet, 2 weeks ago
1 203 2 weeks ago
Plugins · by complanar, 1 month ago
2 480 4 weeks ago
Plugins · by Vladimir Novak, 2 months ago
3 759 2 months ago