Seibertron wrote:Basically, I'm working on creating a script that will "requeue" and "reprocess" failed missions [...] The script will grab a few missions which has characters not currently doing something else at the moment, requeue the mission using current timestamps, and then forcing their processing so that I can properly debug this damn code. [...] Once I get all of this working again, I'll modify this script to process all battles that failed that are in the database still.
Nearly all missions have 20 minutes between closing signups and updating characters with the cached results, with nearly all battles/logs getting processed within the first minute. That should give a decent amount of time to try the battle again if it's got the process flag but hasn't been properly completed in, say, five minutes after its start time (or, for that matter, to run a mission multiple times for debug purposes and just keep the last run's result). Outside of that time, no guarantee that bots would be available or that they'd have the same level & stats as when they entered, and you could get some very strange effects if characters suddenly & randomly became busy while players are e.g. doing upgrades - I'd honestly rather shrug off the failed mission than have my bots unexpectedly dropping into a battle/CR at some future point.
Would it be easier to amend the end-of-mission update to not release the characters from the mission if it's not correctly processed, and clear the process flag? That should automatically re-queue the mission as I understand it, since the battle script was just looking for missions in the queue that were 1) past their start time and 2) not marked as processing (also applies to the suggestion above - just substitute "has participants but no winner" and "marked as processing at least 5 min ago" in the queue check). Feel free to ignore if that's no longer the case.
Seibertron wrote:If I can't figure this out, I might just rewrite the whole mission and arena log process which has been needed to be done since day 1 of HMW. That's on the agenda anyways but it might happen sooner than later if I can't figure this out.
Given how much time a full rewrite would take and that one of the earlier Silver Age announcements was that the whole site's code is now under version control, can the recent changes not just be rolled back while you're investigating what went wrong?