Skip to content

Commit 85ff1ee

Browse files
author
Sam J Sharpe
committed
Merge pull request alphagov#7 from alphagov/ungraceful-nginx
It was taking too long to turn it off & on again
2 parents dc5ab23 + 888502f commit 85ff1ee

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nginx.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ def gracefulstop(wait=True):
99
# Poll for Nginx, until it's no longer running.
1010
run('while pgrep nginx >/dev/null; do echo "Waiting for Nginx to exit.."; sleep 1; done')
1111

12+
@task
13+
def killnginx():
14+
"""Shut down Nginx immediately without waiting for it to finish running"""
15+
sudo('service nginx stop')
16+
1217
@task
1318
def gracefulstart():
1419
"""Start up Nginx on a machine"""
@@ -17,5 +22,5 @@ def gracefulstart():
1722
@task
1823
def hello_it():
1924
"""Turns Nginx off and on again"""
20-
gracefulstop()
25+
killnginx()
2126
gracefulstart()

0 commit comments

Comments
 (0)