summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-02-02 10:11:40 +0100
committeremkael <emkael@tlen.pl>2019-02-02 10:11:40 +0100
commit0a44c13af147f2689b128933de51b0caa685254c (patch)
tree2dea457c0a5126600d655e3845a41065a5b98c5e
parentd0a4c536428599e77fdd00d3d93a1c2158ab387c (diff)
Introducing random delays in FB cache refresh
-rwxr-xr-xbin/refresh-fb-cache.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/refresh-fb-cache.php b/bin/refresh-fb-cache.php
index b8711a0..8c384a6 100755
--- a/bin/refresh-fb-cache.php
+++ b/bin/refresh-fb-cache.php
@@ -1,6 +1,8 @@
#!/usr/bin/env php
<?php
+sleep(rand(35, 70));
+
$BASEPATH = dirname(__FILE__);
chdir($BASEPATH);
@@ -26,6 +28,7 @@ foreach ($cacheFiles as $file) {
$filesToFetch = ['Piwoteka', $fileToFetch];
foreach ($filesToFetch as $feed) {
+ sleep(rand(35, 70));
$provider = new \Providers\Facebook($feed, ['force' => TRUE]);
if (!$provider->get()) {
throw new \Exception(sprintf('Feed %s failed to fetch!', $feed));