Skip to content
Snippets Groups Projects
Commit 94c9ef3f authored by Diego Sampaio's avatar Diego Sampaio Committed by Gabriel Engel
Browse files

changed statistics behavior

parent 15d3e44e
No related branches found
No related tags found
No related merge requests found
......@@ -2,22 +2,23 @@
SyncedCron.config
collectionName: 'rocketchat_cron_history'
generateStatistics = ->
statistics = RocketChat.statistics.save()
statistics.host = Meteor.absoluteUrl()
unless RocketChat.settings.get 'Statistics_opt_out'
HTTP.post 'https://rocket.chat/stats',
data: statistics
return
Meteor.startup ->
Meteor.defer ->
generateStatistics()
# Generate and save statistics every hour
SyncedCron.add
name: 'Generate and save statistics',
schedule: (parser) -># parser is a later.parse object
return parser.text 'every 1 hour'
job: ->
statistics = RocketChat.statistics.save()
statistics.host = Meteor.absoluteUrl()
unless RocketChat.settings.get 'Statistics_opt_out'
console.log 'Sending statistics data to Rocket.Chat'
HTTP.post 'https://rocket.chat/stats',
data: statistics
return
job: generateStatistics
SyncedCron.start()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment