Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor contact archivation #1146

Merged
merged 22 commits into from
Sep 16, 2020
Merged

Refactor contact archivation #1146

merged 22 commits into from
Sep 16, 2020

Conversation

artur-intech
Copy link
Contributor

@artur-intech artur-intech commented Apr 4, 2019

  • New task: contacts:archive
  • Archive inactive contacts every midnight
  • Change log_domains.children column's type to jsonb

@ratM1n

Fixes #956

@artur-intech artur-intech force-pushed the refactor-contact-archivation branch from 3692fdd to f7fa2d2 Compare April 4, 2019 16:02
@artur-intech artur-intech assigned vohmar and unassigned vohmar Apr 4, 2019
@artur-intech artur-intech force-pushed the refactor-contact-archivation branch from f7fa2d2 to b8fa0e2 Compare April 5, 2019 10:12
@artur-intech artur-intech force-pushed the refactor-contact-archivation branch from b8fa0e2 to 6e1b13c Compare April 5, 2019 10:41
@artur-intech artur-intech requested a review from vohmar April 5, 2019 10:41
@artur-intech artur-intech removed the request for review from vohmar April 5, 2019 10:48
@artur-intech artur-intech force-pushed the refactor-contact-archivation branch from 6e1b13c to ebd7a32 Compare April 11, 2019 14:46
@artur-intech artur-intech assigned artur-intech and unassigned vohmar Apr 11, 2019
@artur-intech artur-intech force-pushed the refactor-contact-archivation branch 4 times, most recently from 2893bff to 80fd043 Compare April 23, 2019 09:04
@artur-intech artur-intech force-pushed the refactor-contact-archivation branch 5 times, most recently from 0ec123c to f2ab9e8 Compare June 13, 2019 08:49
@artur-intech artur-intech force-pushed the refactor-contact-archivation branch 3 times, most recently from 75f7dd2 to c162f6d Compare June 17, 2019 16:21
@artur-intech artur-intech force-pushed the refactor-contact-archivation branch 2 times, most recently from f3a3381 to 2b1d9ac Compare June 19, 2019 14:37
@artur-intech artur-intech mentioned this pull request Jun 20, 2019
@karlerikounapuu karlerikounapuu force-pushed the refactor-contact-archivation branch from 80cd567 to 7a24eab Compare September 3, 2020 07:58
@karlerikounapuu karlerikounapuu force-pushed the refactor-contact-archivation branch from b25180a to 6707ca1 Compare September 3, 2020 09:27
@karlerikounapuu karlerikounapuu marked this pull request as ready for review September 3, 2020 09:59
@karlerikounapuu karlerikounapuu force-pushed the refactor-contact-archivation branch from ae690f6 to c91b913 Compare September 4, 2020 12:06
@karlerikounapuu karlerikounapuu force-pushed the refactor-contact-archivation branch from c91b913 to a5b59f2 Compare September 4, 2020 12:20
@karlerikounapuu
Copy link
Member

karlerikounapuu commented Sep 4, 2020

Use bundle exec rake contacts:archive to archive contacts. As the task is ultimately time consuming, it's possible to start it again from the point it reached via contact id. This can be done via bundle exec rake contacts:archive[123], where 123 is the last contact.id which was processed (this can be obtained from tasks's stdout)

Changes
Populate config/application.yml with contact_archivation_log_file_dir. For example '/opt/webapps/app/export/contact_archivations'

In case of initial launch
Run bundle exec rake contacts:archive[0,true]. Second argument determines whether it's initial launch. In case it is, it logs destroyed contact object to directory specificed in ENV['contact_archivation_log_file_dir'] and skips poll messaging. Skipping initial processing can be continued later on as well, just replace 0 with last contact ID.

@karlerikounapuu karlerikounapuu force-pushed the refactor-contact-archivation branch from 6aea236 to db77147 Compare September 16, 2020 07:26
@karlerikounapuu karlerikounapuu force-pushed the refactor-contact-archivation branch from db77147 to ab1fa90 Compare September 16, 2020 07:38
@karlerikounapuu karlerikounapuu force-pushed the refactor-contact-archivation branch from 9cc25e0 to 7e9a325 Compare September 16, 2020 09:16
@vohmar vohmar merged commit 26aab66 into master Sep 16, 2020
@vohmar vohmar deleted the refactor-contact-archivation branch September 17, 2020 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Destory orphans cron task does not archive unlinked contacts
5 participants