Skip to content

Commit

Permalink
fix(gitlab): fix something with parser get repo thing
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevillamartin committed Oct 12, 2017
1 parent 169e91f commit c62d258
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Discord/Commands/GitlabInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions lib/Gitlab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions lib/Models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down

0 comments on commit c62d258

Please sign in to comment.