pkp / docker-ojs

Open Journal Systems (OJS) is a journal management and publishing system.
GNU General Public License v3.0
60 stars 47 forks source link

Statistics are not working "out of the box" #43

Open marcbria opened 3 years ago

marcbria commented 3 years ago

Docker image includes a helper script (/usr/local/bin/ojs-run-scheduled) that is supposed to process the statistics. This script is called by cron hourly, so there is no need to use Anacron (poor's man cron) plugin.

The problem is this script calls the statistics parser as follows: https://github.com/pkp/docker-ojs/blob/3c0f3d446a0ecd5278c26f64d26441d9a28e35d6/templates/common/ojs/usr/local/bin/ojs-run-scheduled#L4

When the call requires a parameter: https://docs.pkp.sfu.ca/admin-guide/en/statistics#2-configure-a-server-side-cron-job

Solution Modify the script to process statistics as follows: $ tools/runScheduledTasks.php plugins/generic/usageStats/scheduledTasks.xml

Improvement Would be nice to accept arguments for this script... although if is called without params, keep processing as regular OJS logs (for backward compativity).

This make sense in case you like to manage an unified crontab outside the dockers and run them as follows $docker exec -it ojs_app_papers ojs-run-scheduled.

marcbria commented 2 years ago

BTW, an obvious temporary workaround is enable the "Acron" plugin.