File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ deploy:
58
58
after_deploy :
59
59
- pip install requests
60
60
- python bin/update_status_on_pr.py
61
+ - status_code=$(curl --write-out %{http_code} --silent --output /dev/null https://$TRAVIS_BRANCH-dot-sympy-live-hrd.appspot.com/status)
62
+ - echo "App status code => $status_code"
63
+ - if [ "$status_code" != "200" ]; then travis_terminate; fi
61
64
62
65
env :
63
66
global :
Original file line number Diff line number Diff line change @@ -829,12 +829,22 @@ def get(self):
829
829
830
830
self .response .out .write ("Your queries have been deleted." )
831
831
832
+
832
833
class RedirectHandler (webapp .RedirectHandler ):
833
834
"""Redirects deprecated pages to the frontpage."""
834
835
835
836
def get (self ):
836
837
self .redirect ('/' , permanent = True )
837
838
839
+
840
+ class StatusHandler (webapp .RequestHandler ):
841
+ """Status endpoint to check if the app is running or not."""
842
+
843
+ def get (self ):
844
+ self .response .headers ['Content-Type' ] = 'application/json'
845
+ self .response .out .write (json .dumps ({"status" : "ok" }))
846
+
847
+
838
848
application = webapp .WSGIApplication ([
839
849
('/' , FrontPageHandler ),
840
850
('/evaluate' , EvaluateHandler ),
@@ -845,4 +855,5 @@ def get(self):
845
855
('/shellmobile' , RedirectHandler ),
846
856
('/shelldsi' , RedirectHandler ),
847
857
('/helpdsi' , RedirectHandler ),
858
+ ('/status' , StatusHandler ),
848
859
], debug = _DEBUG )
You can’t perform that action at this time.
0 commit comments