MDL-41198 lib: Allow PHP to generate random seed on script start

Most srand instances are removed to allow PHP to do the work.

srand was left for group randomization due to the method used.

Conflicts:

	lib/tests/accesslib_test.php
This commit is contained in:
Russell Smith
2013-12-18 16:56:50 +11:00
parent e6af311972
commit 02ea7c378c
5 changed files with 3 additions and 14 deletions
-1
View File
@@ -67,7 +67,6 @@ function cron_run() {
// Run cleanup core cron jobs, but not every time since they aren't too important.
// These don't have a timer to reduce load, so we'll use a random number
// to randomly choose the percentage of times we should run these jobs.
srand ((double) microtime() * 10000000);
$random100 = rand(0,100);
if ($random100 < 20) { // Approximately 20% of the time.
mtrace("Running clean-up tasks...");