2 Commits

Author SHA1 Message Date
Alan Guo Xiang Tan
ae0625323a
FIX: Avoid errors when updating post and topic count user stats. (#15876)
In ab5361d69ae4b55a7635676eef7d80dd96d8460c, we rescue from the PG error
but the transaction is already aborted causing any DB query after to
fail. As such, we avoid triggering the error in the first place by
checking that we would not be insertin a negative number into the
counter cache.

Follow-up to ab5361d69ae4b55a7635676eef7d80dd96d8460c
2022-02-09 21:48:18 +08:00
Alan Guo Xiang Tan
ab5361d69a
FIX: Avoid raising error when updating post and topic count user stats. (#15873)
There are still spots in the code base which results in us trying to turn the post and topic count negative. However,
we have a job that runs on a daily basis which will correct the count. Therefore, avoid raising an error for now
and log the exception instead.
2022-02-09 12:51:13 +08:00