diff --git a/lib/Discord/Commands/GitlabInit.js b/lib/Discord/Commands/GitlabInit.js index 5ebcb39..efc5873 100644 --- a/lib/Discord/Commands/GitlabInit.js +++ b/lib/Discord/Commands/GitlabInit.js @@ -57,7 +57,7 @@ class GitlabInitCommand extends Command { }); } - return Gitlab.getRepo(repoUser, repoName).then(res => { + return Gitlab.getRepo(repository.repo).then(res => { const repoInfo = res.body; const repoActualName = repoInfo.path_with_namespace; const conf = ChannelConfig.FindByChannel(channelid); diff --git a/lib/Gitlab/index.js b/lib/Gitlab/index.js index bc3bff3..cba091c 100644 --- a/lib/Gitlab/index.js +++ b/lib/Gitlab/index.js @@ -125,8 +125,8 @@ class Gitlab { } _getRepoID(ownerOrId, name) { - const repo = name && parse(`${ownerOrId}/${name}`); - return (repo ? repo.repo : ownerOrId).replace(/\//g, '%2F'); + const data = name && parse(`${ownerOrId}/${name}`); + return (data ? data.repo : ownerOrId).replace(/\//g, '%2F'); } _request(url, params) { diff --git a/lib/Models/index.js b/lib/Models/index.js index 7a43a9b..f13044a 100644 --- a/lib/Models/index.js +++ b/lib/Models/index.js @@ -2,8 +2,9 @@ const mongoose = require('mongoose'); mongoose.connect(process.env.YAPPY_GITLAB_MONGODB || 'localhost', { useMongoClient: true, - server: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } }, - replset: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } }, + autoReconnect: true, + keepAlive: 1, + connectTimeoutMS: 30000, }) .then(() => { Log.info(`MongoDB | Connected to DB`);