Closed Banonevar closed 5 years ago
!lg, !gm not working too. Only !score, !medal working correctly
Sounds like it's a problem with findGameFromChannel, but I haven't encountered it. Is it the same for any account? Are the collections games and rps getting filled?
Looks like I removed printing of errors somewhere, try changing
if (err instanceof CustomError) {
return err.message
}
lines 49-51 on index.js to
if (err instanceof CustomError) {
return err.message
}
else {
console.log(err)
}
and tell what it prints
Same for all channels and accounts
Yea, games
and rps
is filling, will try add that log to index.js
19|AIBT | MongoError: Exceeded memory limit for $group, but didn't allow external sort. Pass allowDiskUse:true to opt in.
19|AIBT | at Connection.<anonymous> (/root/scripts/aibt/node_modules/mongodb-core/lib/connection/pool.js:443:61)
19|AIBT | at Connection.emit (events.js:196:13)
19|AIBT | at processMessage (/root/scripts/aibt/node_modules/mongodb-core/lib/connection/connection.js:364:10)
19|AIBT | at TLSSocket.<anonymous> (/root/scripts/aibt/node_modules/mongodb-core/lib/connection/connection.js:533:15)
19|AIBT | at TLSSocket.emit (events.js:196:13)
19|AIBT | at addChunk (_stream_readable.js:290:12)
19|AIBT | at readableAddChunk (_stream_readable.js:271:11)
19|AIBT | at TLSSocket.Readable.push (_stream_readable.js:226:10)
19|AIBT | at TLSWrap.onStreamRead (internal/stream_base_commons.js:166:17) {
19|AIBT | operationTime: Timestamp { _bsontype: 'Timestamp', low_: 10, high_: 1558630929 },
19|AIBT | ok: 0,
19|AIBT | errmsg: "Exceeded memory limit for $group, but didn't allow " +
19|AIBT | 'external sort. Pass allowDiskUse:true to opt in.',
19|AIBT | code: 16945,
19|AIBT | codeName: 'Location16945',
19|AIBT | '$clusterTime': {
19|AIBT | clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 10, high_: 1558630929 },
19|AIBT | signature: { hash: [Binary], keyId: [Long] }
19|AIBT | },
19|AIBT | name: 'MongoError',
19|AIBT | [Symbol(mongoErrorContextSymbol)]: {}
19|AIBT | }
I added allowDiskUse:true, seems like no error like that, more, need to test commands. Btw is is safe? Is it will use much RAM or something?
Yeah, try passing allowDiskUse:true like it says
you can add an index createdAt with expireAfterSeconds: 1800 to the collections games and rps I have an index createdAt with expireAfterSeconds: 21600 in collection last games and dac
they're mostly to save space, but i guess on collections games and rps it's more important
Thx!
What is dac
?
A collection of info about games from steam webapi It's currently used for storing info about games that an account is watching (normal spectating with delay, not as a caster/camera person/live spectating with dota plus)
Can i have latest question? What model of object must be for notable players
collection?
I just want import all Pro Players from opendota, and wan't know structure of your DB
Can you provide just 1 example of object for that collection?
{
id:'id',
channel:'channel id for local or empty string for global',
name:'name',
enabled:true
}
id is the account id of the player, i think it has to be in a string because of how it was written in the code
channel is the id of the twitch channel the player will be shown, empty string for global, again string for the same reason
for example
{
id:'1',
channel:'',
name:'test',
enabled:true
}
to have the account id 1
show as test
globally
Oh, it's enought info! I'm very appreciated
Hey again, seems like allowDiskUse:true
no more working, and mongo keep spam that error again. Also i added indexes, but it's not helped too
db.games.getIndexes()
[
{
"v" : 2,
"key" : {
"_id" : 1
},
"name" : "_id_",
"ns" : "mmrbot.games"
},
{
"v" : 2,
"key" : {
"createdAt" : 1
},
"name" : "createdAt_1",
"ns" : "mmrbot.games",
"expireAfterSeconds" : 21600
}
]
try having the expireAfterSeconds on 1800 both on games and rps collection I opened a new issue (#30) about this problem, i'll make the change later today or tomorrow
Commit 6535874616d974fc736fe425c0e3b252ba0d762e fixes this problem by taking only the documents from the past 15 minutes into the aggregations
@Hambergo does that mean bot will know games only for 15 minutes? I mean if game was started 30 mins ago and it's still playing, bot will not know about this game?
Well, i updated to latest master, and got Game wasn't found
on !np command, but game in progress on 5700 avg mmr
The bot will know about it, the bot requests to know which game everyone is currently playing every 30s, it'll only take games everyone reported currently playing from the last 15 minutes (the bot allows for up to 10 minutes of delaying the result for np so further than that is not needed. The delay is mostly used to have with having stream delay on or spectating games to not get spoilers)
I'm not sure why it happened, but if you added a new ID it can take 30s to start showing
I'm droped all indexes, and it seems working now! Great job!
Hm, or not. BOt was know about game only first 10 minutes of game, when 10 minutes pass, he start sayin game wasn't found
Wow that sounds weird, does the same happen if you try to add the same account to 9kmmrbot on a channel?
Or is it possible that the user went offline on steam? Because if the game isn't showing in the top 100 games on watch tab it can stop showing
Yes, same.
No, user online
Can you try again? It looks like you didn't wait 30s between adding and trying, and I added on my channel and it worked
Well, now it's ok from 9kmmrbot, but not from mine
Can you tell what is returned from
db.games.find({players.account_id:405655217})
and db.rps.find({account_id:405655217})
It's returned much objects, how i can filter them?
Sort by createdAt and return the few newest results and results from when it worked, if possible
I'v use !np command, and it's return nothing. No rejections like
Game wasn't found
. Just nothing. No errors console, no chat. Account added to chanel, account in dota match, but bot gives nothing. Why it can happens?