From f89b15a60e0ef7449d1b28f6c53c0e385bfc64b7 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Tue, 31 Oct 2017 15:35:13 -0400 Subject: [PATCH] clear cache on post-commit update --- controller/Controller.class.php | 4 +++- update.php | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/controller/Controller.class.php b/controller/Controller.class.php index 8ccc81e8..4e194753 100644 --- a/controller/Controller.class.php +++ b/controller/Controller.class.php @@ -2,6 +2,8 @@ class Controller { + const CACHE_CLEAR_PATH = '/clear-cache'; + protected static $queuedFunctions = []; public static function dispatch($uri) @@ -97,7 +99,7 @@ class Controller $router->post('/postcommit', 'OpsActions::executePostCommit'); $router->post('/log-upload', 'OpsActions::executeLogUpload'); - $router->get('/clear-cache', 'OpsActions::executeClearCache'); + $router->get(static::CACHE_CLEAR_PATH, 'OpsActions::executeClearCache'); $router->any('/list/subscribe', 'MailActions::executeSubscribe'); $router->any('/list/subscribed', 'MailActions::executeSubscribed'); diff --git a/update.php b/update.php index 5b8e033d..40f501c9 100755 --- a/update.php +++ b/update.php @@ -21,3 +21,6 @@ Shell::exec('git fetch && git reset --hard origin/master'); View::compileCss(); View::gzipAssets(); + +// clear cache +Curl::get('localhost'.Controller::CACHE_CLEAR_PATH); \ No newline at end of file