<commit_before># Config and Start SyncedCron
logger = new Logger 'SyncedCron'

SyncedCron.config
	logger: (opts) ->
		logger[opts.level].call(logger, opts.message)
	collectionName: 'rocketchat_cron_history'

generateStatistics = ->
	statistics = RocketChat.statistics.save()
	statistics.host = Meteor.absoluteUrl()
	if RocketChat.settings.get 'Statistics_reporting'
		try
			HTTP.post 'https://collector.rocket.chat/',
				data: statistics
		catch e
			logger.warn('Failed to send usage report')
	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: generateStatistics

		SyncedCron.start()
<commit_msg>Schedule syncedcron to run every one hour at the startup minute<commit_after># Config and Start SyncedCron
logger = new Logger 'SyncedCron'

SyncedCron.config
	logger: (opts) ->
		logger[opts.level].call(logger, opts.message)
	collectionName: 'rocketchat_cron_history'

generateStatistics = ->
	statistics = RocketChat.statistics.save()
	statistics.host = Meteor.absoluteUrl()
	if RocketChat.settings.get 'Statistics_reporting'
		try
			HTTP.post 'https://collector.rocket.chat/',
				data: statistics
		catch e
			logger.warn('Failed to send usage report')
	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.cron new Date().getMinutes() + ' * * * *'
			job: generateStatistics

		SyncedCron.start()

{'fraction_non_alphanumeric': 0.1048951048951049, 'fraction_numerical': 0.0005827505827505828, 'mean_word_length': 4.283076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1652679', 'n_tokens_mistral': 603, 'n_tokens_neox': 535, 'n_words': 143}