]> git.mxchange.org Git - friendica.git/blobdiff - include/cron.php
Revert unneeded changes in third-party libraries
[friendica.git] / include / cron.php
index 1607d4d95f0849a7f8897039425d76e12681a0c2..58a3fcf9ce9e5f54ad8dabca0fde89821e44dce1 100644 (file)
@@ -20,7 +20,7 @@ function cron_run(&$argv, &$argc){
        }
        if ($last) {
                $next = $last + ($poll_interval * 60);
-               if ($next > time()) {
+               if($next > time()) {
                        logger('cron intervall not reached');
                        return;
                }
@@ -104,14 +104,15 @@ function cron_poll_contacts($argc, $argv) {
        $force      = false;
        $restart    = false;
 
-       if (($argc > 1) && ($argv[1] == 'force'))
+       if (($argc > 1) && ($argv[1] == 'force')) {
                $force = true;
-
+       }
        if (($argc > 1) && ($argv[1] == 'restart')) {
                $restart = true;
                $generation = intval($argv[2]);
-               if (!$generation)
+               if (!$generation) {
                        killme();
+               }
        }
 
        if (($argc > 1) && intval($argv[1])) {
@@ -130,9 +131,9 @@ function cron_poll_contacts($argc, $argv) {
        // we are unable to match those posts with a Diaspora GUID and prevent duplicates.
 
        $abandon_days = intval(get_config('system','account_abandon_days'));
-       if($abandon_days < 1)
+       if ($abandon_days < 1) {
                $abandon_days = 0;
-
+       }
        $abandon_sql = (($abandon_days)
                ? sprintf(" AND `user`.`login_date` > UTC_TIMESTAMP() - INTERVAL %d DAY ", intval($abandon_days))
                : ''
@@ -203,29 +204,35 @@ function cron_poll_contacts($argc, $argv) {
 
                                switch ($contact['priority']) {
                                        case 5:
-                                               if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 month"))
+                                               if (datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 month")) {
                                                        $update = true;
+                                               }
                                                break;
                                        case 4:
-                                               if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 week"))
+                                               if (datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 week")) {
                                                        $update = true;
+                                               }
                                                break;
                                        case 3:
-                                               if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day"))
+                                               if (datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day")) {
                                                        $update = true;
+                                               }
                                                break;
                                        case 2:
-                                               if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 12 hour"))
+                                               if (datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 12 hour")) {
                                                        $update = true;
+                                               }
                                                break;
                                        case 1:
                                        default:
-                                               if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 hour"))
+                                               if (datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 hour")) {
                                                        $update = true;
+                                               }
                                                break;
                                }
-                               if (!$update)
+                               if (!$update) {
                                        continue;
+                               }
                        }
 
                        logger("Polling ".$contact["network"]." ".$contact["id"]." ".$contact["nick"]." ".$contact["name"]);