venusbb
55a27fed13
fixed a bug on reporting_task
2018-03-23 11:40:27 +00:00
kentsanggds
6e9bab5544
Merge pull request #1778 from alphagov/pyup-update-notifications-python-client-4.7.2-to-4.8.1
...
Update notifications-python-client to 4.8.1
2018-03-23 10:35:16 +00:00
kentsanggds
77de45b105
Merge pull request #1792 from alphagov/pyup-update-moto-1.2-to-1.3.1
...
Update moto to 1.3.1
2018-03-23 10:34:52 +00:00
kentsanggds
d793a55b9c
Merge pull request #1779 from alphagov/pyup-update-pyjwt-1.6.0-to-1.6.1
...
Update pyjwt to 1.6.1
2018-03-23 10:34:09 +00:00
kentsanggds
832c350b69
Merge pull request #1789 from alphagov/ken-fix-no-sent_by
...
Set sent_by if not set during sms provider callback
2018-03-23 09:52:26 +00:00
pyup-bot
3acaba0a33
Update moto from 1.2 to 1.3.1
2018-03-22 18:40:55 +00:00
Venus Bailey
8c282aa406
Merge pull request #1791 from alphagov/vb-report-tasks
...
Add statd to monitoring the length of task
2018-03-22 17:22:36 +00:00
venusbb
444365faa5
add statd
2018-03-22 17:17:03 +00:00
Ken Tsang
c272d023c4
Lowercase the client name when sent_by is empty
2018-03-22 16:12:33 +00:00
Venus Bailey
1d7381400d
Merge pull request #1787 from alphagov/vb-report-tasks
...
Command for migrating data to ft_billing [#155511547 ]
2018-03-22 09:37:46 +00:00
Ken Tsang
ffa093d8c7
Set sent_by if not set during sms provider callback
...
- refactored argument reference to provider_reference to make it clearer
2018-03-21 18:11:10 +00:00
venusbb
9aa2536997
use sql parametrize rather than python format
2018-03-21 17:04:51 +00:00
kentsanggds
5dc0248043
Merge pull request #1783 from alphagov/ken-process-antivirus
...
Send task to antivirus app and process antivirus callbacks
2018-03-21 16:39:55 +00:00
Ken Tsang
d6f6669610
Add comments for copying s3 objects
2018-03-21 16:33:49 +00:00
venusbb
4b25654cbf
update record rather than ignore when duplicate
2018-03-21 15:37:49 +00:00
Ken Tsang
5481d743ac
change failed virus scan log to error
2018-03-21 15:30:58 +00:00
venusbb
b9953dd005
Command to migrate data to ft_billing
2018-03-21 15:21:16 +00:00
Venus Bailey
40a3986720
Merge pull request #1786 from alphagov/vb-report-tasks
...
Primary key for ft_billing table should use notification_type
2018-03-21 15:18:23 +00:00
venusbb
af975b89ec
primary key for ft_billing should use notification_type
2018-03-21 15:02:08 +00:00
Venus Bailey
b59a59f45a
Merge pull request #1785 from alphagov/vb-report-tasks
...
Add import to reporting_tasks in scheduled tasks
2018-03-21 10:48:01 +00:00
venusbb
378feda603
put import reporting_tasks in config
2018-03-21 10:39:00 +00:00
venusbb
cf019864e2
Preserve 'unknown' in ft_billing for sms if the provider is not known.
2018-03-21 09:50:34 +00:00
venusbb
ecef20523b
Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-report-tasks
2018-03-20 17:24:32 +00:00
venusbb
07aa44ea82
Add import report_tasks to schedule_tasks.
2018-03-20 16:42:24 +00:00
Rebecca Law
81f9c06e06
Merge pull request #1781 from alphagov/only-use-data-on-queue-not-from-db
...
Remove unused code in send_delivery_status_to_service task
2018-03-20 16:13:42 +00:00
Rebecca Law
30cbc45872
Merge pull request #1784 from alphagov/optimize-todays-services-query
...
Optimise query for platform-admin/live-services and trial-services
2018-03-20 16:13:27 +00:00
Rebecca Law
0798154fa2
Optimize the query used to return the services and todays notification totals.
...
By changing the created_at filter to use a specific date range I found a significant improvement to the queries performance.
The unit test needed to change because now were are returning todays date as BST the local timezone.
Query plan before
Merge Left Join (cost=1226133.76..1226143.77 rows=1753 width=70) (actual time=5800.160..5801.657 rows=1849 loops=1)
Merge Cond: (services.id = anon_1.service_id)
-> Sort (cost=152.99..157.37 rows=1753 width=46) (actual time=2.205..2.631 rows=1762 loops=1)
Sort Key: services.id
Sort Method: quicksort Memory: 224kB
-> Seq Scan on services (cost=0.00..58.54 rows=1753 width=46) (actual time=0.011..1.156 rows=1762 loops=1)
Filter: active
Rows Removed by Filter: 101
-> Sort (cost=1225980.77..1225980.99 rows=86 width=40) (actual time=5797.949..5797.984 rows=198 loops=1)
Sort Key: anon_1.service_id
Sort Method: quicksort Memory: 40kB
-> Subquery Scan on anon_1 (cost=1225976.29..1225978.01 rows=86 width=40) (actual time=5797.682..5797.823 rows=198 loops=1)
-> HashAggregate (cost=1225976.29..1225977.15 rows=86 width=48) (actual time=5797.681..5797.747 rows=198 loops=1)
Group Key: notifications.notification_type, notifications.notification_status, notifications.service_id
-> Seq Scan on notifications (cost=0.00..1220610.86 rows=536543 width=48) (actual time=0.064..5482.975 rows=643799 loops=1)
Filter: (((key_type)::text <> 'TEST'::text) AND (date(created_at) = '2018-03-20'::date))
Rows Removed by Filter: 6804774
Planning time: 1.106 ms
Execution time: 5802.130 ms
Query plan after
Merge Left Join (cost=953378.30..953388.30 rows=1753 width=70) (actual time=2380.144..2382.499 rows=1852 loops=1)
Merge Cond: (services.id = anon_1.service_id)
-> Sort (cost=152.99..157.37 rows=1753 width=46) (actual time=2.944..3.570 rows=1762 loops=1)
Sort Key: services.id
Sort Method: quicksort Memory: 224kB
-> Seq Scan on services (cost=0.00..58.54 rows=1753 width=46) (actual time=0.006..1.294 rows=1762 loops=1)
Filter: active
Rows Removed by Filter: 101
-> Sort (cost=953225.31..953225.53 rows=86 width=40) (actual time=2377.194..2377.262 rows=201 loops=1)
Sort Key: anon_1.service_id
Sort Method: quicksort Memory: 40kB
-> Subquery Scan on anon_1 (cost=953220.83..953222.55 rows=86 width=40) (actual time=2376.797..2377.034 rows=201 loops=1)
-> HashAggregate (cost=953220.83..953221.69 rows=86 width=48) (actual time=2376.795..2376.905 rows=201 loops=1)
Group Key: notifications.notification_type, notifications.notification_status, notifications.service_id
-> Bitmap Heap Scan on notifications (cost=29883.14..947856.24 rows=536459 width=48) (actual time=270.061..1887.754 rows=644735 loops=1)
Recheck Cond: ((created_at >= '2018-03-20 00:00:00'::timestamp without time zone) AND (created_at < '2018-03-21 00:00:00'::timestamp without time zone))
Rows Removed by Index Recheck: 947427
Filter: ((key_type)::text <> 'TEST'::text)
Heap Blocks: exact=40882 lossy=186483
-> Bitmap Index Scan on ix_notifications_created_at (cost=0.00..29749.02 rows=536459 width=0) (actual time=258.631..258.631 rows=644849 loops=1)
Index Cond: ((created_at >= '2018-03-20 00:00:00'::timestamp without time zone) AND (created_at < '2018-03-21 00:00:00'::timestamp without time zone))
Planning time: 0.548 ms
Execution time: 2383.485 ms
2018-03-20 15:48:32 +00:00
Ken Tsang
8391353113
Update tasks in line with AV app
2018-03-20 14:56:42 +00:00
Ken Tsang
d9494dbc97
Refactor tests after rebase
2018-03-20 14:56:26 +00:00
Chris Hill-Scott
0b4821cb81
Merge pull request #1782 from alphagov/rother
...
Add Rother District Council logo for letters
2018-03-20 11:58:45 +00:00
Chris Hill-Scott
80fd2d73f7
Add Rother District Council logo for letters
2018-03-20 11:12:15 +00:00
Ken Tsang
65733a30a1
Add send_task to antivirus app for scanning precompiled letters
2018-03-20 10:12:59 +00:00
Ken Tsang
b1ac580e0a
Add celery tasks to handle virus scan passing and failing
2018-03-20 10:12:59 +00:00
Ken Tsang
0c102f0727
Update letter utils for methods to handle virus process
...
- add function to get reference from filename
- add function to move pdf from scan folder to process folder
- add function to delete pdfs from scan bucket for failed virus scans
2018-03-20 10:12:59 +00:00
Ken Tsang
4ace33cc04
Add queue and task names to config
2018-03-20 10:12:59 +00:00
Ken Tsang
8e78c5f286
Refactor letter test
...
- move letter tests from test_post_notifications.py to test_post_letter_notifications.py
2018-03-20 10:12:59 +00:00
Ken Tsang
8733d84e75
Upload precompiled letter pdfs to letters-scan bucket
2018-03-20 10:11:36 +00:00
Ken Tsang
30e371fa4c
Set precompiled letters to pending virus check initially
2018-03-20 10:11:36 +00:00
Ken Tsang
055a5ee7eb
Add letter-scan bucket name to config
2018-03-20 10:11:36 +00:00
Rebecca Law
ee46803a12
The send_delivery_status_to_service task was refactor to take the details of the notification and service api callback such that the task no longer needed to go to the database to provide the status update.
...
This PR removes the code that is no longer used. This extra step was necessary to keep the tasks backward compatible.
2018-03-19 17:38:20 +00:00
Rebecca Law
22c296b0ef
Merge pull request #1780 from alphagov/send-service-callback-if-sent_at_is-None
...
Send service callback if sent at is none
2018-03-19 16:32:15 +00:00
Rebecca Law
fdfd6838a6
Fix error message.
...
The id in the message is referring to a notification not a service
2018-03-19 15:24:59 +00:00
Rebecca Law
cd2d85f2a3
Updates after code review.
...
- Remove print
- Update exception message.
2018-03-19 14:08:38 +00:00
Venus Bailey
a810bb4e40
Merge pull request #1771 from alphagov/vb-billing-periodic
...
Fine tune reporting model and create task for migrating data [#155511547 ]
2018-03-19 09:17:39 +00:00
pyup-bot
62e5c9742b
Update pyjwt from 1.6.0 to 1.6.1
2018-03-18 13:39:46 +00:00
Rebecca Law
0dc50190b2
Throw an exception whenever we updated a notification to technical failure.
...
If this is happening we want to know about it.
2018-03-16 17:18:44 +00:00
Sakis
06f05360b0
Merge pull request #1776 from alphagov/worker-connection-pool
...
Set db connection pool size to 1 for all workers
2018-03-16 16:27:59 +00:00
pyup-bot
4fd472f53c
Update notifications-python-client from 4.7.2 to 4.8.1
2018-03-16 14:55:34 +00:00
Rebecca Law
c9477a7400
When a notification is timed out in the scheduled task that may happen because the notification has not been sent.
...
Which means the sent_at date for the notification could be empty causing the service callback to fail.
- Allow code to work if notification.sent_at or updated_at is None
- Update calls to send_delivery_status_to_service to send the data encrypted so that the task does not need to use the db.
2018-03-16 14:47:56 +00:00
Rebecca Law
5db110bb3f
Merge pull request #1777 from alphagov/fix-last_template_usage_query-performance
...
Optimise dao_get_last_template_usage query
2018-03-16 14:46:35 +00:00