Add slight delay when stopping the metadata API
This commit is contained in:
parent
39c9f911cc
commit
364ab10673
|
@ -24,6 +24,7 @@ import gevent.pywsgi
|
||||||
import flask
|
import flask
|
||||||
import threading
|
import threading
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
import psycopg2
|
import psycopg2
|
||||||
from psycopg2.extras import RealDictCursor
|
from psycopg2.extras import RealDictCursor
|
||||||
|
|
||||||
|
@ -112,7 +113,9 @@ class MetadataAPIInstance(object):
|
||||||
self.logger.out('Stopping Metadata API at 169.254.169.254:80', state='i')
|
self.logger.out('Stopping Metadata API at 169.254.169.254:80', state='i')
|
||||||
try:
|
try:
|
||||||
self.md_http_server.stop()
|
self.md_http_server.stop()
|
||||||
|
time.sleep(0.1)
|
||||||
self.md_http_server.close()
|
self.md_http_server.close()
|
||||||
|
time.sleep(0.1)
|
||||||
self.md_http_server = None
|
self.md_http_server = None
|
||||||
self.logger.out('Successfully stopped Metadata API', state='o')
|
self.logger.out('Successfully stopped Metadata API', state='o')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in New Issue