From 57d94be3f8577bd0ea86f4a86d4a62108c7cb391 Mon Sep 17 00:00:00 2001 From: Kai Hendry Date: Sun, 25 Oct 2015 20:05:13 +0800 Subject: [PATCH] Make create.php return instantly whilst kicking off a fetch ! --- www/create.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/create.php b/www/create.php index 54021a0..ee46041 100755 --- a/www/create.php +++ b/www/create.php @@ -40,7 +40,7 @@ echo "

Goto http://$id.$HTT $logfile = "fetch-" . time() . ".log"; // Only update Appcache file once we are done with the fetch -exec(sprintf("../../fetch-tweets.sh %s > %s 2>&1 && sed -e 's,TIMESTAMP,%s,' ../../greptweet.appcache > greptweet.appcache &", $id, $logfile, date("c"))); +exec(sprintf("nohup sh -c '../../fetch-tweets.sh %s && sed -e 's,TIMESTAMP,%s,' ../../greptweet.appcache > greptweet.appcache' >%s 2>&1 &", $id, date("c"), $logfile)); // Remove logs older than a day `find -name '*.log' -mtime +1 -exec rm {} \; &`;