Merge pull request #11 from AAVikings/master

Fixing remove bot
This commit is contained in:
benme authored and GitHub committed 2019-07-17 08:34:07 -03:00
commit dcefa8da76
4 files changed
+15 -1

No files matched your search

+1
View File
@@ -36,6 +36,7 @@ const resolve = async (parent, { bot }, context) => {
products: [auxProduct]
}
auxTeam.bots.push(newBotClone)
userEcosystem.markModified("devTeams")
break
}
}
+12 -1
View File
@@ -39,7 +39,17 @@ const resolve = async (parent, { team }, context) => {
// Teams will be created on a local minio container
let botsConfigurations = []
await createContainer(team.codeName)
try {
await createContainer(team.codeName)
} catch (err) {
if (err.message !== 'Your previous request to create the named bucket succeeded and you already own it.') {
logger.error('addTeam -> Error: %s', err.stack)
throw err
} else {
logger.warn('addTeam -> %s', err.message)
}
}
let tradingBot = await copyBot(team.codeName, team.bot.codeName, team.bot.displayName, writeFileContent)
botsConfigurations.push(tradingBot)
let simulatorBot = await copySimulator(team.codeName, team.bot.codeName, team.bot.displayName, writeFileContent)
@@ -59,6 +69,7 @@ const resolve = async (parent, { team }, context) => {
}
userEcosystem.devTeams.push(team)
userEcosystem.markModified("devTeams")
await userEcosystem.save()
return team
} catch (err) {
+1
View File
@@ -32,6 +32,7 @@ const resolve = async (parent, { team }, context) => {
teamFound = true
await deleteContainer(team.codeName)
userEcosystem.devTeams.splice(i, 1)
userEcosystem.markModified("devTeams")
await userEcosystem.save()
break
}
+1
View File
@@ -29,6 +29,7 @@ const resolve = async (parent, { bot }, context) => {
if (auxProduct.codeName === bot.productCodeName) {
removedBotClone = auxBot
auxTeam.bots.splice(j, 1)
userEcosystem.markModified("devTeams")
break
}
}