Open AlessandroCordella opened 2 years ago
I am using the example version of subscribeAllCardUpdates.js just changing the query:
const { ActionCable } = require('@sorare/actioncable'); const cable = new ActionCable({ headers: { // 'Authorization': `Bearer <YourJWTorOAuthToken>`, // 'APIKEY': '<YourOptionalAPIKey>' } }); var query = "aCardWasUpdated(rarities: [limited, rare, super_rare, unique]) " + "{slug, id, onSale, rarity, liveSingleSaleOffer{price, blockchainId, endDate, open}, player{displayName}}"; cable.subscribe(query, { connected() { console.log("connected"); }, disconnected(error) { console.log("disconnected", error); }, rejected(error) { console.log("rejected", error); }, received(data) { if (data?.result?.errors?.length > 0) { console.log('error', data?.result?.errors); return; } const aCardWasUpdated = data?.result?.data?.aCardWasUpdated; if (!aCardWasUpdated) { console.log("A card was not updated"); return; } else { //something console.log("Something"); } } });
Why does the code work only for some time? After a random amount of minutes (3m,7m, 31m,...), the script doesn't exit, but it doesn't print anything else; therefore I don't know if and where it is stuck.
Having same issue
found the answer here https://github.com/sorare/api/issues/236#issuecomment-1177591987
found the answer here #236 (comment)
He using javascript, this forum show with python
I am using the example version of subscribeAllCardUpdates.js just changing the query:
Why does the code work only for some time? After a random amount of minutes (3m,7m, 31m,...), the script doesn't exit, but it doesn't print anything else; therefore I don't know if and where it is stuck.