Browse Source

reset domain hit quota on feed update start

Andrew Dolgov 3 months ago
parent
commit
8c3efd51ec
2 changed files with 8 additions and 0 deletions
  1. 2 0
      classes/rssutils.php
  2. 6 0
      include/functions.php

+ 2 - 0
classes/rssutils.php

@@ -259,6 +259,8 @@ class RSSUtils {
 	 */
 	static function update_rss_feed($feed, $no_cache = false) {
 
+		reset_fetch_domain_quota();
+
 		Debug::log("start", Debug::$LOG_VERBOSE);
 
 		$pdo = Db::pdo();

+ 6 - 0
include/functions.php

@@ -164,6 +164,12 @@
 	    Debug::log($msg);
 	}
 
+	function reset_fetch_domain_quota() {
+		global $fetch_domain_hits;
+
+		$fetch_domain_hits = [];
+	}
+
 	// TODO: max_size currently only works for CURL transfers
 	// TODO: multiple-argument way is deprecated, first parameter is a hash now
 	function fetch_file_contents($options /* previously: 0: $url , 1: $type = false, 2: $login = false, 3: $pass = false,