Friday, June 21, 2019

Changelog 2019-06-22 - Two Fixes

Both fixes relate to the Reddit SwapBot not storing swaps that are archived.

For context, the bot maintains a list of "archived" comments aka comments that are unconfirmed and older than 3 days. It moves these comments to the archive list where it checks them once a day for the next 27 days before finally dumping them. However, there was an issue where the archive run was taking so long to run that a normal run would happen while the archive run was still happening but finish after the archive run, thus overwriting and changed to the database that the archive run made. This was fixed with two tricks...

Archive runs block out ten minutes of time.

Archive runs only less than 5 minutes to run, but if we try to do a normal run any time less than 10 minutes after the start of an archive run, the program will return right away. This prevents us from having conflicts while running.

Tags that are replies to tags will be ignored.

The real reason this was an issue though is because some of the folks on r/pkmntcgtrades like to tag the bot while replying to a tag. For example, user A tags user B and the Bot. User B then replies to user A by tagging user A and the Bot. This looks like a brand new attempt to confirm a trade in the eyes of the Bot, so it adds it to its list. Of course, this never gets "confirmed" because, as far as A and B know, they already confirmed the trade. So the Bot wastes resources checking B's comment that will never be confirmed (and even if it was confirmed, it would be thrown out anyway due to deduplication efforts). So now the bot will ignore these comments entirely.

No comments:

Post a Comment

Hot Cash Give Away Jan 2021

  Hey everyone! Time for another round of Hot Cash codes! Hot Cash ends soon so be sure to use these ASAP! Comment below with the codes you ...