owncloud-archive / news

:newspaper: News app for ownCloud
GNU Affero General Public License v3.0
290 stars 106 forks source link

How to disable message "Ajax or webcron cron mode detected!" #957

Closed tiker closed 8 years ago

tiker commented 8 years ago

Is there an option to disable the message "Ajax or webcron cron mode detected! ...." from the top of the screen without changing the cron setup?

Ajax updates work fine for myself and the users of the system and I don't know why the message is showing for people who aren't admins of the server and don't have the ability to make the changes that are even suggested...

Is there a config or toggle to disable this message or is modifying the addon files the only way?

BernhardPosselt commented 8 years ago

Ajax cron is not working fine, use the provided python updater (which does parallel updates over HTTP and in master also parallel feed updates over cli) or system cron. The message can't be disabled because it's not supported and won't work properly.

tiker commented 8 years ago

It has been working fine for me. What doesn't work?

I don't need regular updates every 15 minutes type of thing.. I check my news feeds maybe once per day and it looks fine and updated when I do check...

(Do note that I have just installed this to replace a separate news reader application so I can read my news feeds from different computers.)

BernhardPosselt commented 8 years ago

Several issues:

BernhardPosselt commented 8 years ago

The last point also affects the web cron implementation, which is why it's also unsupported.

tiker commented 8 years ago

I see how it could be a problem for larger installations but my setup and user group is small and isn't impacted by the issues you've listed.

In my setup (which is a personal setup with up to 4 family members logged on) Ajax cron jobs run quite frequently because a job runs every time someone access a publicly shared file like images from the internet.

Perhaps an idea would be to break up the feed updates into feed specific jobs so a single Ajax page load fires off a single cron job to update a single feed. That should reduce the time each feed update runs significantly for larger deployments.

BernhardPosselt commented 8 years ago

I see how it could be a problem for larger installations but my setup and user group is small and isn't impacted by the issues you've listed.

Depends on the webserver configuration and feed update time. Even if everything updates fine, the page load times are wayyy too slow once you trigger ajax cron.

Perhaps an idea would be to break up the feed updates into feed specific jobs so a single Ajax page load fires off a single cron job to update a single feed. That should reduce the time each feed update runs significantly for larger deployments.

Already implemented in the updater API. As for the ajax cron: this was not done because it pushes back other cronjobs, which means that file system cleanup jobs can be pushed back indefinitely based on the number of feeds.

All in all it's a possible source of aweful bugs which are not limited to the app itself, slow and leads to horrible user experience due to load times.

If this still does not convince you, feel free to fork and apply your own changes. Removing the warning should be as easy as removing the first line here: https://github.com/owncloud/news/blob/master/templates/part.content.php#L1

However don't ask for support in this repo, you need to deal with the consequences by yourself ;)

tiker commented 8 years ago

Thanks for the information. :)

I'll see if I can break down the feed updates to separate jobs as well with the updater API. With the shared images, web search engines hitting the pages, the main owncloud page, people trying to guess passwords, etc. all run ajax jobs so I'm never behind. (I check up on the oc_jobs table every now and then.) :)

Thanks

BernhardPosselt commented 8 years ago

API docs are here: https://github.com/owncloud/news/wiki/Cron-1.2

Here is an implementation in Python: https://github.com/owncloud/news/tree/master/bin/updater

tiker commented 8 years ago

Thank you.