ソースを参照

Merge pull request #940 from Alkarex/PshbErrorManagement

PubSubHubbub prevent subscribing too often in case of error
Alexandre Alapetite 10 年 前
コミット
43c35b72ea
1 ファイル変更8 行追加1 行削除
  1. 8 1
      app/Models/Feed.php

+ 8 - 1
app/Models/Feed.php

@@ -475,7 +475,14 @@ class FreshRSS_Feed extends Minz_Model {
 				file_put_contents($hubFilename, json_encode($hubJson));
 			}
 
-			return substr($info['http_code'], 0, 1) == '2';
+			if (substr($info['http_code'], 0, 1) == '2') {
+				return true;
+			} else {
+				$hubJson['lease_start'] = time();	//Prevent trying again too soon
+				$hubJson['error'] = true;
+				file_put_contents($hubFilename, json_encode($hubJson));
+				return false;
+			}
 		}
 		return false;
 	}