Skip to content

Commit 05ff925

Browse files
committed
Fix tests
1 parent 9714d87 commit 05ff925

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

ch11/microservices/thoughts_backend/ThoughtsBackend/thoughts_backend/api_namespace.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ def post(self):
7777
db.session.add(new_thought)
7878
db.session.commit()
7979

80-
raise Exception('Unexpected error!')
81-
8280
result = api_namespace.marshal(new_thought, thought_model)
8381

8482
return result, http.client.CREATED

ch11/microservices/thoughts_backend/ThoughtsBackend/thoughts_backend/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ def create_app(script=False):
9494
application.config['REQUEST_ID_UNIQUE_VALUE_PREFIX'] = ''
9595
RequestID(application)
9696

97-
# Initialise metrics
98-
metrics.init_app(application)
99-
10097
if not script:
10198
# For scripts, it should not connect to Syslog
10299
handler = logging.handlers.SysLogHandler(('syslog', 5140))
@@ -108,6 +105,9 @@ def create_app(script=False):
108105
# Do not propagate to avoid log duplication
109106
application.logger.propagate = False
110107

108+
# Initialise metrics
109+
metrics.init_app(application)
110+
111111
api = Api(application, version=VERSION, title='Thoughts Backend API',
112112
description='A Simple CRUD API')
113113

0 commit comments

Comments
 (0)