Changeset 1487
- Timestamp:
- 08/14/11 16:34:02 (22 months ago)
- Location:
- Files:
-
- 2 modified
-
files/lib/system/cronjob/TwitterUpdateJob.class.php (modified) (4 diffs)
-
package.xml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
twitter/files/lib/system/cronjob/TwitterUpdateJob.class.php
r1339 r1487 16 16 */ 17 17 public function execute($data) { 18 19 // with every run decreaes fail count 20 $sql = "UPDATE wcf".WCF_N."_twitter_feed 21 SET failcount = failcount - 1 22 WHERE failcount > 0"; 23 WCF::getDB()->sendQuery($sql); 24 25 // get active feeds 18 26 $sql = "SELECT * 19 27 FROM wcf".WCF_N."_twitter_feed ti 20 28 INNER JOIN wcf".WCF_N."_twitter_account ta ON ti.accountID = ta.accountID 21 29 INNER JOIN wcf".WCF_N."_user_to_twitter utt ON utt.accountID = ta.accountID 22 WHERE ti.failcount < 5";30 WHERE ti.failcount < 4"; 23 31 $result = WCF::getDB()->sendQuery($sql); 24 32 $i = 0; … … 28 36 } 29 37 30 // try to activ e system user feeds38 // try to activate system user feeds 31 39 if($i == 0) { 32 40 $user = $this->getSystemUser(); 33 41 if($user) { 34 $sql = "INSERT I NTO42 $sql = "INSERT IGNORE INTO 35 43 wcf".WCF_N."_twitter_feed 36 44 (accountID, action) 37 45 VALUES (".intval($user['accountID']).", 'user_timeline'), 38 (".intval($user['accountID']).", 'mentions') 39 ON DUPLICATE KEY UPDATE 40 failcount = IF(failcount > 1, failcount - 1, 0)"; 46 (".intval($user['accountID']).", 'mentions')"; 41 47 $result = WCF::getDB()->sendQuery($sql); 42 48 } … … 106 112 // increase fail count and stop 107 113 $sql = 'UPDATE wcf'.WCF_N.'_twitter_feed 108 SET failcount = failcount + 1114 SET failcount = failcount + 3 109 115 WHERE feedID = '.intval($me['feedID']); 110 116 WCF::getDB()->sendQuery($sql); … … 137 143 $sql = 'UPDATE wcf'.WCF_N.'_twitter_feed 138 144 SET since_id = '.intval($maxid + 1).', 139 failcount = IF(failcount > 1, failcount - 1, 0) 145 failcount = 0 146 WHERE feedID = '.intval($me['feedID']); 147 WCF::getDB()->sendQuery($sql); 148 } 149 150 else if($me['failcount']) { 151 152 // reset fail count, if everything is ok 153 $sql = 'UPDATE wcf'.WCF_N.'_twitter_feed 154 SET failcount = 0 140 155 WHERE feedID = '.intval($me['feedID']); 141 156 WCF::getDB()->sendQuery($sql); -
twitter/package.xml
r1458 r1487 4 4 <packagename><![CDATA[Twitter (WCF)]]></packagename> 5 5 <packagedescription><![CDATA[Twitter is a service for friends, family, and co–workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: What are you doing?]]></packagedescription> 6 <version>2.3. 0</version>6 <version>2.3.1</version> 7 7 <date>DATE</date> 8 8 <isunique>1</isunique> … … 42 42 <languages languagecode="de-informal">de.xml</languages> 43 43 <languages languagecode="en">en.xml</languages> 44 </instructions> 45 <instructions type="update" fromversion="2.3.0"> 46 <files>files.tar</files> 44 47 </instructions> 45 48 <instructions type="update" fromversion="2.2.3">
