<commit_before>var util = require('util');

var Algolia = require('algolia-search');
var appLog = require('../../js/log.js')('app');

var client = new Algolia('0UIFPQ3RGG', process.env.ALGOLIA_API_KEY);
var jsDelivr = client.initIndex('jsDelivr');
var jsDelivrAssets = client.initIndex('jsDelivr_assets');

module.exports = function updateIndex (projects, assets) {
	jsDelivr.saveObjects(projects, function (error, content) {
		if (error) {
			appLog.err(util.format('Error (jsDelivr): %s', content.message));
		} else {
			appLog.info('jsDelivr index successfully updated.')
		}
	});

	jsDelivrAssets.saveObjects(assets, function (error, content) {
		if (error) {
			appLog.err(util.format('Error (jsDelivr_assets): %s', content.message));
		} else {
			appLog.info('jsDelivr_assets index successfully updated.')
		}
	});
};<commit_msg>Fix a path broken with ba3ae2bca5681be1f0ffd8933f0a8f719fa58fe6<commit_after>var util = require('util');

var Algolia = require('algolia-search');
var appLog = require('../../log.js')('app');

var client = new Algolia('0UIFPQ3RGG', process.env.ALGOLIA_API_KEY);
var jsDelivr = client.initIndex('jsDelivr');
var jsDelivrAssets = client.initIndex('jsDelivr_assets');

module.exports = function updateIndex (projects, assets) {
	jsDelivr.saveObjects(projects, function (error, content) {
		if (error) {
			appLog.err(util.format('Error (jsDelivr): %s', content.message));
		} else {
			appLog.info('jsDelivr index successfully updated.')
		}
	});

	jsDelivrAssets.saveObjects(assets, function (error, content) {
		if (error) {
			appLog.err(util.format('Error (jsDelivr_assets): %s', content.message));
		} else {
			appLog.info('jsDelivr_assets index successfully updated.')
		}
	});
};
{'fraction_non_alphanumeric': 0.1609529343404997, 'fraction_numerical': 0.013945380592678676, 'mean_word_length': 5.354243542435424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5423302', 'n_tokens_mistral': 656, 'n_tokens_neox': 617, 'n_words': 115}