From 0377ab640a87fe169de730f3121b124a217b8894 Mon Sep 17 00:00:00 2001 From: Brendan Heywood Date: Tue, 4 Feb 2025 11:42:33 +1100 Subject: [PATCH] Store cookies in per worker local file #193 --- classes/robot/crawler.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/robot/crawler.php b/classes/robot/crawler.php index 1547fa3..b116465 100644 --- a/classes/robot/crawler.php +++ b/classes/robot/crawler.php @@ -1090,7 +1090,12 @@ private static function determine_filesize($curlhandle, $method, $success, $body public function scrape($url) { global $CFG; - $cookiefilelocation = $CFG->dataroot . '/tool_crawler_cookies.txt'; + + static $cookiefilelocaion = ''; + if (!$cookiefilelocation) { + $cookiefilelocation = make_request_directory() . '/tool_crawler_cookies.txt'; + } + $config = self::get_config(); $version = moodle_major_version();