diff options
author | Giteabot <teabot@gitea.io> | 2023-12-12 11:28:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-12 03:28:56 +0000 |
commit | 6f4d5c0b8c924660d29f8fe2ca2b92b1848981bd (patch) | |
tree | e60fc2d1ef7794efdb32087dca3817e6978f8672 /services/markup | |
parent | 1ec622db243ef97432989751f083d308fde7c2fb (diff) | |
download | gitea-6f4d5c0b8c924660d29f8fe2ca2b92b1848981bd.tar.gz gitea-6f4d5c0b8c924660d29f8fe2ca2b92b1848981bd.zip |
Recover from panic in cron task (#28409) (#28425)
Backport #28409 by @earl-warren
- Currently there's code to recover gracefully from panics that happen
within the execution of cron tasks. However this recover code wasn't
being run, because `RunWithShutdownContext` also contains code to
recover from any panic and then gracefully shutdown Forgejo. Because
`RunWithShutdownContext` registers that code as last, that would get run
first which in this case is not behavior that we want.
- Move the recover code to inside the function, so that is run first
before `RunWithShutdownContext`'s recover code (which is now a noop).
Fixes: https://codeberg.org/forgejo/forgejo/issues/1910
Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Diffstat (limited to 'services/markup')
0 files changed, 0 insertions, 0 deletions