etcgroup / text-prizm

3 stars 0 forks source link

Dashboard activities cron #81

Closed michaelbrooks closed 11 years ago

michaelbrooks commented 11 years ago

Creates a new controller for lumping code instances together into apply-codes activities.

The controller is meant to be run from the command line, as a cron job.

For each user, it performs the following:

  1. Find the user's most recent apply-codes activity that is already listed.
  2. Find any of the user's instances that occurred after that activity.
  3. Go through the instances, creating an activity on every gap (and at the end if the last one is old enough).

It uses a gap of 20 minutes currently.

In doing this I also added two optional parameters to the activities model, and hence the activities REST API.