]> git.mxchange.org Git - friendica.git/commitdiff
proper split cronjob functions
authorPhilipp Holzer <admin@philipp.info>
Mon, 22 Apr 2019 12:22:00 +0000 (14:22 +0200)
committerPhilipp Holzer <admin@philipp.info>
Mon, 22 Apr 2019 12:22:00 +0000 (14:22 +0200)
src/Model/Nodeinfo.php
src/Worker/CronJobs.php

index 560629b6a1e501b8fe5079e5f6efa17b704701a2..60eba2713aecbca6188b21a7357392ee462afa68 100644 (file)
@@ -5,7 +5,6 @@ namespace Friendica\Model;
 use Friendica\BaseObject;
 use Friendica\Core\Addon;
 use Friendica\Database\DBA;
-use Friendica\Util\Network;
 
 /**
  * Model interaction for the nodeinfo
@@ -46,8 +45,6 @@ class Nodeinfo extends BaseObject
                        return;
                }
 
-               $logger->info('cron_start');
-
                $userStats = User::getStatistics();
 
                $config->set('nodeinfo', 'total_users', $userStats['total_users']);
@@ -63,13 +60,5 @@ class Nodeinfo extends BaseObject
                $local_comments = DBA::count('item', ["`origin` AND `id` != `parent` AND NOT `deleted` AND `uid` != 0"]);
                $config->set('nodeinfo', 'local_comments', $local_comments);
                $logger->debug('item statistics', ['local_comments' => $local_comments]);
-
-               // Now trying to register
-               $url = 'http://the-federation.info/register/' . $app->getHostName();
-               $logger->debug('Check registering url', ['url' => $url]);
-               $ret = Network::fetchUrl($url);
-               $logger->debug('Check registering answer', ['answer' => $ret]);
-
-               $logger->info('cron_end');
        }
 }
index 2618541ddbda0d757f1dc270e2dc4f2f1273c62d..ad971c8f32fad0ffb16165d2a40b306bec017cc0 100644 (file)
@@ -21,6 +21,7 @@ use Friendica\Model\Photo;
 use Friendica\Model\User;
 use Friendica\Network\Probe;
 use Friendica\Protocol\PortableContact;
+use Friendica\Util\Network;
 use Friendica\Util\Proxy as ProxyUtils;
 
 require_once 'mod/nodeinfo.php';
@@ -44,7 +45,14 @@ class CronJobs
                                break;
 
                        case 'nodeinfo':
+                               Logger::info('cron_start');
                                Nodeinfo::update();
+                               // Now trying to register
+                               $url = 'http://the-federation.info/register/' . $app->getHostName();
+                               Logger::debug('Check registering url', ['url' => $url]);
+                               $ret = Network::fetchUrl($url);
+                               Logger::debug('Check registering answer', ['answer' => $ret]);
+                               Logger::info('cron_end');
                                break;
 
                        case 'expire_and_remove_users':