summaryrefslogtreecommitdiffstats
path: root/lib/backgroundjob.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-10-14 21:15:16 +0200
committerBart Visscher <bartv@thisnet.nl>2012-10-14 21:15:47 +0200
commit1e37bc139bb28e6fe9b0dd0d477e2dbef5a2cab9 (patch)
treefa56b07316b914f39e2dd02b70a61b05b016b967 /lib/backgroundjob.php
parent365cecd2ec1bf2552ae0d8e064680ed36b0bf04e (diff)
Whitespace cleanup
Diffstat (limited to 'lib/backgroundjob.php')
-rw-r--r--lib/backgroundjob.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/backgroundjob.php b/lib/backgroundjob.php
index 896fd6f03..9495086f0 100644
--- a/lib/backgroundjob.php
+++ b/lib/backgroundjob.php
@@ -37,7 +37,7 @@ class Backgroundjob {
return 1;
}
}
-
+
static public function run() {
if( \OC::$CLI ) {
self::cliStep();
@@ -46,25 +46,25 @@ class Backgroundjob {
self::webStep();
}
}
-
+
static private function cliStep() {
$feedmapper = new FeedMapper();
-
+
// Iterate over all feeds
$feeds = $feedmapper->findAll();
foreach( $feeds as $feed ) {
self::updateFeed( $feedmapper, $feed );
}
}
-
+
static private function webStep() {
// Iterate over all users
$lastid = \OCP\Config::getAppValue('news', 'backgroundjob_lastid',0);
-
+
$feedmapper = new FeedMapper();
$feeds = $feedmapper->findAll();
usort( $feeds, array( 'OCA\News\Backgroundjob', 'sortFeeds' ));
-
+
$done = false;
foreach( $feeds as $feed ) {
if( $feed['id'] > $lastid ) {
@@ -74,12 +74,12 @@ class Backgroundjob {
self::updateFeed( $feedmapper, $feed );
}
}
-
+
if( !$done ) {
\OCP\Config::setAppValue('news', 'backgroundjob_lastid',0);
}
}
-
+
static private function updateFeed( $feedmapper, $feed ) {
$newfeed = null;
$newfeed = Utils::fetch( $feed['url'] );