Ripple's cron script
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Giuseppe Guerra 7482da9e67 Add .drone.yml 1 month ago
.vscode vscode 7 months ago
heap CalculatePP with max heap 6 months ago
.drone.yml Add .drone.yml 1 month ago
.gitignore Add the ability to use different conf files 11 months ago
LICENSE Update LICENSE and README 4 years ago Add the ability to use different conf files 11 months ago
cache_data.go Beatmap playcount: do not truncate, lower threshold 7 months ago
calculate_accuracy.go Revert "Chunk queries instead of loading all data" 2 years ago
calculate_overall_accuracy.go ho ho ho what will it be? 2 years ago
calculate_pp.go Removed unnecessary join 6 months ago
cron.go New donorbot expire url 1 month ago
fix_multiple_completed_scores.go Make cron shut up a bit 3 years ago
fix_score_duplicates.go ... 2 years ago
fix_stats_overflow.go Add FixStatsOverflow 11 months ago
hanayo.go Log SetOnlineUsers done 6 months ago
redis.go Relax leaderboards 7 months ago
replays.go Forgot to remove the actual files 🤔 3 years ago
serverwise_stats.go Add server-wise stats calc 11 months ago


The fastest cron for ripple you’ll never need.

A bit of explaination here:

Ripple uses a cronjob to fix any eventual errors in the database. For doing it, it used cron.php, a terribly performing script. No, really. That’s three minutes of server CPU being used at 100%!

So I decided to rewrite it to be better performant, and what better language to do it if not Go (well, C, C++ and Assembly are indeed faster, but I’m not on that level of insanity).

This is the result: (watch the video especially for the last 30 seconds, as you can see the true power of ripple-cron-go).


Assuming you have Go installed and your GOPATH set up

go get -u
cd $GOPATH/src/
go build
nano cron.conf
./ripple-cron-go # Boom!


This is an example of a very simple unit of ripple-cron-go:

package main

import (


func opTimeConsumingTask() {
	defer wg.Done()

	color.Green("> TimeConsumingTask: done!", count)

Then you would add a bool in the config struct to enable/disable the task, then this to cron.go (cron.go contains main())

	if c.TimeConsumingTask {
		verboseln("Starting time consuming task")
		go opTimeConsumingTask()

CLI Arguments

root@c021393c3a8a:/go/src/ ./ripple-cron-go -h                 
Usage of ./ripple-cron-go:
  -config string
    	Configuration file (default "cron.conf")
  -v	verbose
    	very verbose (LogQueries)


By default, ripple-cron-go outputs very little information to stdout. You can increase the amount of logged information with the -v flag. This will show the progress of each job.
The -vv flag will log queries as well and it should be used only for debugging purposes.

Multiple configs

You can also specify multiple .conf files (es: hourly.conf and daily.conf) and then run ripple-cron-go with a specific config file with:

$ ./ripple-cron-co -config=hourly.conf
$ ./ripple-cron-co -config=daily.conf

If the specified .conf file does not exist, ripple-cron-go will create it and populate it with default settings.
If no -config flag is provided, cron.conf will be used as configuration file.


All code in this repository is licensed under the GNU AGPL 3 License.
See the “LICENSE” file for more information.