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

Made several improvements to JotForm sync to reduce API load and improve resilience #22954

Merged
merged 1 commit into from Jun 7, 2018

Conversation

aoby
Copy link
Contributor

@aoby aoby commented Jun 7, 2018

Changes:

  • Decrease cronjob frequency from every minute to every 5 minutes
  • Store form questions in the Rails cache (5 min TTL), so they're not re-queried between syncs. This is mostly useful for the rails console, as the cronjob should only make one query per form id anyway.
  • Also memoize questions reference per model instance.
  • No longer greedily pre-sync questions from JotForm. Now, get them in precedence order from 1) cache, 2) our DB, and 3) JotForm.
  • Whenever a submission fails to process and raises an error, THEN force sync the related questions from JotForm and try again once. If it fails again, hard fail.
  • Move standard skip_submission? implementation into the JotFormBackedForm concern, since each model was implementing it the same way. Now require environment for all forms.
  • Add duplicate check to the skip_submission based on all the fields in attribute_mapping
  • Stop syncing Pd::PostCourseSurvey in the cronjob, because it uses the datetime control we don't yet support, and it's not needed yet.

@aoby aoby merged commit 49b7b7e into staging Jun 7, 2018
@aoby aoby deleted the jotform-sync-relief branch June 7, 2018 16:59
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.

None yet

2 participants