/** * disconnect * @summary disconnect mongoOplog */ var disconnect = function (watcher, filePath, Oplog) { var getFileList = Util.readFileList(filePath, [], ".json"); _.find(getFileList, function (item) { logger.logMethod('error', watcher.elasticsearch.e_connection.e_server, watcher.elasticsearch.e_connection.e_index, "mongoOplog error: file is " + JSON.stringify(item.Content)); logger.logMethod('debug', watcher.elasticsearch.e_connection.e_server, watcher.elasticsearch.e_index, ' tailing stopped!'); }); Oplog.destroy(); var task = cron.schedule('0 59 * * * *', () => { tail(watcher, filePath, 0); }); task.destroy(); }