From be948947534c1d8dd90fc774e6f0fad2ad707f65 Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Wed, 29 Nov 2017 17:08:12 +0000 Subject: [PATCH 1/3] fix linter stuff --- tests/app/inbound_sms/test_rest.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/app/inbound_sms/test_rest.py b/tests/app/inbound_sms/test_rest.py index 8299a84d0..323edccb5 100644 --- a/tests/app/inbound_sms/test_rest.py +++ b/tests/app/inbound_sms/test_rest.py @@ -3,10 +3,8 @@ from datetime import datetime import pytest from freezegun import freeze_time -from app.models import ServiceInboundApi, Service from tests.app.db import ( create_inbound_sms, create_service, create_service_with_inbound_number, - create_service_inbound_api ) @@ -291,15 +289,3 @@ def test_get_inbound_sms_by_id_with_invalid_service_id_returns_404(admin_request inbound_sms_id='2cfbd6a1-1575-4664-8969-f27be0ea40d9', _expected_status=404 ) - - -def test_inbound_api_blah(notify_db_session): - service = create_service() - api = create_service_inbound_api(service=service) - - print("***************") - from_db = Service.query.all()[0] - print("--------------------") - from_db_service = from_db.inbound_api - print("***************") - assert 1 == 1 From 388bba23657c17b963f96a78e5fc8c4140fac8b2 Mon Sep 17 00:00:00 2001 From: Richard Chapman Date: Thu, 30 Nov 2017 09:25:28 +0000 Subject: [PATCH 2/3] Decreased Gunicorn threads Increasing the Gunicorn workers to 10 actually made the API decrease in performance from ~200 requests/sec with with 20 API instances to 150 requests per/sec. The base value is 5 so this is to test how the API performs with a slight increase. --- manifest-api-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest-api-staging.yml b/manifest-api-staging.yml index d19455470..05b1d420d 100644 --- a/manifest-api-staging.yml +++ b/manifest-api-staging.yml @@ -1,7 +1,7 @@ --- inherit: manifest-api-base.yml -command: scripts/run_app_paas.sh gunicorn -c /home/vcap/app/gunicorn_config.py --error-logfile /home/vcap/logs/gunicorn_error.log -w 10 -b 0.0.0.0:$PORT application +command: scripts/run_app_paas.sh gunicorn -c /home/vcap/app/gunicorn_config.py --error-logfile /home/vcap/logs/gunicorn_error.log -w 6 -b 0.0.0.0:$PORT application services: - notify-aws - notify-config From e1bc94136b56d1596a801792ecd8d087206e51ff Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Thu, 30 Nov 2017 09:56:44 +0000 Subject: [PATCH 3/3] exclude build folder from flake8 --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index bfe5a2603..fd1d86b57 100644 --- a/.flake8 +++ b/.flake8 @@ -1,7 +1,7 @@ [flake8] # Rule definitions: http://flake8.pycqa.org/en/latest/user/error-codes.html # W503: line break before binary operator -exclude = venv*,__pycache__,node_modules,cache,migrations +exclude = venv*,__pycache__,node_modules,cache,migrations,build ignore = W503 max-complexity = 14 max-line-length = 120