<commit_before>'use strict';

const mongoose = require('mongoose');

const BSON = require('bson').BSON;

const mongoUtil = require('../util/mongo.util');
const redisUtil = require('../util/redis.util');
const counterService = require('./counter.service');
const base58CodecService = require('./base58-codec.service');

let urlConversionMongoSchema = mongoose.Schema({
    short_url: {type: String, index: true},
    long_url: {type: String, index: true},
    created_time: Date
});

let UrlConversionMongoModel = mongoose.model('UrlConversion', urlConversionMongoSchema);

let redisClient = redisUtil.redisClient;

function addByLongUrl(longUrl, callback) {
    counterService.getNextSequenceByCounterName('shortUrlID', function(error, shortUrlIdInstance) {
        if (error) {
            console.log(error);
        }
        var shortUrl = base58CodecService.encode(shortUrlIdInstance.counter_value);
        if (shortUrl === 'api') {
            counterService.getNextSequenceByCounterName('shortUrlID', function(error, shortUrlIdInstance) {
                if (error) {<commit_msg>Clean up<commit_after>'use strict';

const mongoose = require('mongoose');

const mongoUtil = require('../util/mongo.util');
const redisUtil = require('../util/redis.util');
const counterService = require('./counter.service');
const base58CodecService = require('./base58-codec.service');

let urlConversionMongoSchema = mongoose.Schema({
    short_url: {type: String, index: true},
    long_url: {type: String, index: true},
    created_time: Date
});

let UrlConversionMongoModel = mongoose.model('UrlConversion', urlConversionMongoSchema);

let redisClient = redisUtil.redisClient;

function addByLongUrl(longUrl, callback) {
    counterService.getNextSequenceByCounterName('shortUrlID', function(error, shortUrlIdInstance) {
        if (error) {
            console.log(error);
        }
        var shortUrl = base58CodecService.encode(shortUrlIdInstance.counter_value);
        if (shortUrl === 'api') {
            counterService.getNextSequenceByCounterName('shortUrlID', function(error, shortUrlIdInstance) {
                if (error) {
{'fraction_non_alphanumeric': 0.1279887482419128, 'fraction_numerical': 0.005625879043600563, 'mean_word_length': 4.36180904522613, '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': '1206220', 'n_tokens_mistral': 628, 'n_tokens_neox': 631, 'n_words': 122}