codeforamerica / health

Meta repo to view all health project issues
12 stars 4 forks source link

Enqueue to drive immediately when later docs selected #577

Closed alanjosephwilliams closed 7 years ago

ondrae commented 7 years ago

We know later_docs is chosen by the action calfresh_application#upload_later

ondrae commented 7 years ago

A calfresh_app is actually submitted upon signature though.

We need to either wait to enqueue the driving until after docs, or somehow tell a job to not wait the usual hour.

ondrae commented 7 years ago

@daguar and I talked this through.

  1. When an app gets a signature, it will be enqueued to drive two hours later.
  2. When either calfresh_applications#confirmation or calfresh_applications#upload_later happen, the app will be enqueued to drive immediately.

This is possible because we are confident that no apps that have already been driven can be driven again. https://github.com/codeforamerica/gcf-backend/blob/master/app/models/calfresh_application.rb#L83

There is some refactoring to do though.

Instead of calfresh_application.submit starting off a long and hidden process of enqueuing, we'll explicitly pass parameters into .submit.