Commit Graph

7193 Commits

Author SHA1 Message Date
Rebecca Law
d5be82b985 Merge branch 'cycle-notification_history-table' of github.com:alphagov/notifications-api into cycle-notification_history-table 2020-05-05 17:23:23 +01:00
Rebecca Law
25d4d01e1b Update script details 2020-05-05 14:36:51 +01:00
poveyd
664025b316 Update cycle_notification_history.sql 2020-05-05 14:18:46 +01:00
Rebecca Law
2e7ae5618c Remove extra scripts 2020-05-05 12:01:52 +01:00
Rebecca Law
1197c4a50a Plan updates 2020-05-05 12:01:18 +01:00
Rebecca Law
bafb71f766 Merge branch 'cycle-notification_history-table' of github.com:alphagov/notifications-api into cycle-notification_history-table 2020-05-05 11:41:12 +01:00
Rebecca Law
e64af5633a [WIP] 2020-05-05 11:40:57 +01:00
poveyd
4a5d4c75d2 Import from other file and make a few other changes (reorder sequence, add sanity check) 2020-05-05 11:36:43 +01:00
Rebecca Law
0d9782c077 Merge branch 'cycle-notification_history-table' of github.com:alphagov/notifications-api into cycle-notification_history-table 2020-05-05 11:12:37 +01:00
Rebecca Law
0d8e0c13d0 Iterate day by day 2020-05-05 11:12:06 +01:00
poveyd
b425984cd9 Update cycle_notification_history_in_batches.sql 2020-05-05 11:11:21 +01:00
Rebecca Law
0d5b78149f Merge branch 'cycle-notification_history-table' of github.com:alphagov/notifications-api into cycle-notification_history-table 2020-05-04 17:40:21 +01:00
Rebecca Law
b9441c528d Trying to find an efficient way to cycle the data 2020-05-04 17:39:13 +01:00
poveyd
7e4adee84b Update cycle_notification_history.sql 2020-05-04 16:18:06 +01:00
poveyd
557bf7aa7e Update cycle_notification_history_in_batches.sql 2020-05-04 15:55:24 +01:00
poveyd
490d7d8d39 Update cycle_notification_history_in_batches.sql 2020-05-04 15:20:10 +01:00
Rebecca Law
ed0aa61e27 Merge branch 'cycle-notification_history-table' of github.com:alphagov/notifications-api into cycle-notification_history-table 2020-05-04 15:18:57 +01:00
Rebecca Law
01bfcdead6 WIP 2020-05-04 15:18:04 +01:00
poveyd
37f5981de8 Update cycle_notification_history_in_batches.sql 2020-05-04 15:17:45 +01:00
Rebecca Law
8979e19ef3 Merge branch 'cycle-notification_history-table' of github.com:alphagov/notifications-api into cycle-notification_history-table 2020-05-04 13:36:28 +01:00
Rebecca Law
eede6dbda2 README that contains notes to create new manifest file 2020-05-04 13:35:35 +01:00
poveyd
da3b155ae8 Create cycle_notification_history_in_batches.sql 2020-05-04 12:18:25 +01:00
Rebecca Law
abe2555f31 Merge branch 'cycle-notification_history-table' of github.com:alphagov/notifications-api into cycle-notification_history-table 2020-04-30 12:13:23 +01:00
Rebecca Law
dd71db1844 Add a command to insert data into pivot table. 2020-04-30 12:12:48 +01:00
poveyd
3f2cc1df17 Update cycle_notification_history.sql 2020-04-28 15:42:38 +01:00
poveyd
42009beb0c Update cycle_notification_history.sql 2020-04-28 15:03:20 +01:00
Rebecca Law
67b03294e2 Script to add constraints and indexes. 2020-04-28 13:05:13 +01:00
poveyd
d6344d3370 Update cycle_notification_history.sql 2020-04-28 11:43:52 +01:00
poveyd
d087e17f7a Update cycle_notification_history.sql 2020-04-28 11:39:22 +01:00
poveyd
4303eba983 Update cycle_notification_history.sql 2020-04-28 11:21:11 +01:00
poveyd
5b4b238098 Update cycle_notification_history.sql 2020-04-28 10:21:51 +01:00
poveyd
cdbec816b3 Update cycle_notification_history.sql
Added a few steps
2020-04-28 10:20:13 +01:00
Rebecca Law
2d8c6ab494 This is a place to start creating scripts for maintaining the database. 2020-04-28 09:45:09 +01:00
Chris Hill-Scott
26793899d4 Merge pull request #2814 from alphagov/search-letters
Let users search for letters
2020-04-27 15:06:32 +01:00
Leo Hemsted
bd345d0390 Merge pull request #2818 from alphagov/restart-periodic-worker
restart reporting worker after each task
2020-04-27 11:03:07 +01:00
Leo Hemsted
1b8c683194 Merge pull request #2816 from alphagov/autoscaling-fixes
make create_letters_pdf always use right queue
2020-04-27 11:03:00 +01:00
David McDonald
985dddcfdc Merge pull request #2820 from alphagov/six-fragments
Bring in utils to bump max fragments to 6 for SMS
2020-04-24 16:11:58 +01:00
David McDonald
44155d4e7c Bring in utils to bump max fragments to 6 for SMS 2020-04-24 16:01:59 +01:00
Pea M. Tyczynska
6724b2cd74 Merge pull request #2817 from alphagov/update_healthcheck_page
Update _status page - remove references to Travis
2020-04-24 14:09:44 +01:00
Pea Tyczynska
260fd7940d Update healthcheck page - remove travis references
Also remove travis references from the repository
2020-04-24 13:43:00 +01:00
Leo Hemsted
ad419f7592 restart reporting worker after each task
The reporting worker tasks fetch large amounts of data from the db, do
some processing then store back in the database. As the reporting worker
only processes the create nightly billing/stats table tasks, which
aren't high performance or high volume, we're fine with the performance
hit from restarting the worker between every task (which based on
limited local testing takes about a second or so).

This causes some real funky shit with the app_context (used for
accessing current_app.logger). To access flask's global state we use the
standard way of importing `from flask import current_app`. However,
processes after the first one don't have the current_app available on
shut down (they're fine during the actual task running), and are unable
to call `with current_app.app_context()` to create it. They _are_ able
to call `with app.app_context()` to create it, where `app` is the
initial app that we pass in to `NotifyCelery.init_app`.

NotifyCelery.init_app is only called once, in the master process - I
think the application state is then stored and passed to the celery
workers. But then it looks like the teardown might clear it, but it
never gets set up again for the new workers? Unsure.

To fix this, store a copy of the initial flask app on the NotifyCelery
object and then use that from within the shutdown signal logging
function.

Nothing's ever easy ¯\_(ツ)_/¯
2020-04-24 12:28:25 +01:00
Chris Hill-Scott
64674be817 Make allowed notification types explicit in search
By not having a catch-all else, it makes it clearer what we’re
expecting. And then we think it’s worth adding a comment explaining why
we normalise as we do for letters and the `None` case.
2020-04-23 16:06:34 +01:00
Chris Hill-Scott
11008af96a Remove outdated comment 2020-04-23 15:35:25 +01:00
Leo Hemsted
d59b2f4cc9 make create_letters_pdf always use right queue
create-letters-pdf-tasks is for contacting template preview.
letters-tasks is for doing other things around letters (including putting things on template preview queue)
2020-04-22 16:07:51 +01:00
Chris Hill-Scott
9047b273da Save whole letter address into the to field
At the moment we’re not consistent:

Precompiled (API and one-off):
`to` has the whole address
`normalised_to` has nothing

Templated (API, CSV and one off):
`to` has the first line of the address
`normalised_to` has nothing

This commit makes us consistently store the whole address in the `to`
field. We think that people might want to search by postcode, not just
first line of the address.

This commit also starts to populate the normalised_to field with the
address lowercased and with all spaces removed, to make it easier to
search on.
2020-04-22 10:06:25 +01:00
Chris Hill-Scott
7897ae70ce Let users search for letters
Like we have search by email address or phone number, finding an
individual letter is a common task. At the moment users are having to
click through pages and pages of letters to find the one they’re looking
for.

We have to search in the `to` and `normalised_to` fields for now because
we’re not populating the `normalised_to` column for letters at the
moment.
2020-04-21 16:25:37 +01:00
Pea M. Tyczynska
d88b20beec Merge pull request #2813 from alphagov/firetext-check-code-on-failure-only
Check failure code on failure only.
2020-04-21 15:23:26 +01:00
Pea Tyczynska
9782cbc5b5 Check failure code on failure only.
We should check error code on failure only, because if we get an
error code on pending code, we should still set the notification
to pending status.
2020-04-21 13:43:45 +01:00
Pea M. Tyczynska
750a573afc Merge pull request #2812 from alphagov/firetext-000-code
Take into consideration Firetext 000 code - no error.
2020-04-21 12:21:36 +01:00
Pea Tyczynska
385d249787 Take into consideration Firetext 000 code - no error. Also change logs from error to warning 2020-04-21 12:06:28 +01:00