                         dbg("\n******************\n**** STATUS: finished #{done}/#{todo}\n**************")
                         if err
                             errors[project_id] = err
-                        cb()
+                        setTimeout(cb, opts.interval)
             async.mapLimit(projects, opts.limit, f, cb)
     ], (err) ->
         if err


exports.replicate_projects_needing_replication = (opts) ->
    opts = defaults opts,
        age_s     : 5*60  # 5 minutes
        limit     : 10    # max number to replicate simultaneously
        cb        : required
    dbg = (m) -> winston.debug("replicate_projects_needing_replication: #{m}")
    projects = undefined

    opts = defaults opts,
        ttl     : 60*60*24  # time in seconds (up to a week)
        dry_run : true      # don't actually close the projects
        limit   : 2         # number of projects to close simultaneously.
        interval: 3000      # space out the project closing to give server a chance to do other things.
        unset_loc : false   # whether to unset the location field in the database after closing the project; if done, then projects will resume later on a random host (which is usually *NOT* desirable).
        cb      : required
