For me, two decades without making money was probably too conservative, YMMV. My heart started going out of my shareware business in the early 2000s when it became more about keeping up with Apple's frequent changes and API deprecation than making games. Technology cycles in the 90s lasted maybe 3-5 years but today that's shrunk to maybe 1 year or even 6 months. So I have abandoned the notion of sustainability in my development, and instead try to focus on fundamentals, basically paring down my plan to the point where I could imagine working on it half asleep or having never seen it before. Because I know that in just a year or two, it will be harder to resurrect the code than just rewrite it in whatever wizbang methodology comes along. Case in point: Node.js, Swift, Rust, Go, Unity, etc etc etc. Basically it’s become easier to wait for an API to arrive than write one yourself. That was a bitter pill for me to swallow as a back end developer.
The other big deal breaker for me was loss of autonomy. When the code begins to rot (as it always does) then someone has to go in and renovate it. Since I was the hacker, that task generally fell on my shoulders. It got to the point where the entirety of my time was spent on damage control. I had initially enjoyed that kind of work, but once it became an expectation, I lost my passion for it.
So the most important lesson I learned is that if you are being compelled to perform work by others, rather than governing your own fate, it’s time to leave:
https://www.youtube.com/watch?v=UQrPVmcgJJk