I've had to quit a couple of jobs due to the fact that
staying there maintaining the same old code base ...
would have been what resulted in my burnout.
Agreed––though if this is a problem for you, try consulting. But it's easy to forget that boredom can cause burnout too.