Open Toeofdoom opened 6 years ago
A workable solution (in case we decide to implement it):
Take calculate_user_stats
outside of the era loop. Add changed_cond
to Era
schema, with default "True"
(but potentially being something like "(p == Profession.MESMER or p == Profession.NECROMANCER) and e == Elite.PATH_OF_FIRE"
). Preload eras' id
and changed_cond
fields. Iterate on all accounts with newly uploaded encounters (or all accounts if --force
), then for a given user iterate on preloaded era id
backwards. After all encounters from an era have been processed, evaluate eval("lambda p, e, a: %s" % era.changed_cond)(participation, elite, archetype)
for all data sections. If True
, era is considered new, so finalise it (and reset data) before we continue to the next earlier era, and copy result to all previous False
eras for this (p, e, a)
. If False
, remember this era for the current (p, a, e)
, do not finalise or reset data.
This would increase processing time, but I don't think by much, and would not impact the memory situation.
The idea is to say "this era was a mirage nerf/bug fix - reset group stats and mirage stats but other profession stats are combined with the previous era"
Note this might not be easy but it should be technically feasible