src/cache/server/cache-server.js
function collectionUpdate (collection, result) {
	result._id = createID(result.pattern, result.language);
	return collection.insertOne(result)
		.catch((e) => {
			// May fail due to concurrent update on the same value.
			log(`collectionUpdate: error: ${e}`);
			return Promise.resolve(PATTERN_INVALID);
		});
}
function collectionUpdate (collection, result) {
	result._id = createID(result.pattern, result.language);
	return collection.insertOne(result)
		.catch((e) => {
			// May fail due to concurrent update on the same value.
			log(`collectionUpdate: error: ${e}`);
			return Promise.resolve(PATTERN_INVALID);
		});
}
function collectionUpdate ( collection , result ) { result . _id = createID ( result . pattern , result . language ) ; return collection . insertOne ( result ) . catch ( ( e ) => { // May fail due to concurrent update on the same value. log ( ` ${ e } ` ) ; return Promise . resolve ( PATTERN_INVALID ) ; } ) ; }
Helper for reportResult.
Helper for reportResult .