codecombat/scripts/recalculateAchievements.coffee

21 lines
617 B
CoffeeScript
Raw Normal View History

2014-07-24 09:05:26 -04:00
database = require '../server/commons/database'
mongoose = require 'mongoose'
log = require 'winston'
async = require 'async'
### SET UP ###
do (setupLodash = this) ->
GLOBAL._ = require 'lodash'
_.str = require 'underscore.string'
_.mixin _.str.exports()
GLOBAL.tv4 = require('tv4').tv4
2014-07-24 09:05:26 -04:00
database.connect()
2016-04-07 12:40:53 -04:00
EarnedAchievementHandler = require '../server/handlers/earned_achievement_handler'
2014-07-24 09:05:26 -04:00
log.info 'Starting earned achievement recalculation...'
EarnedAchievementHandler.constructor.recalculate (err) ->
log.error err if err?
log.info 'Finished recalculating all earned achievements.'
process.exit()