I'm always discouraged by setbacks. I try to forgive myself, but I tend to forgive myself too much by eating nonstop! What can I do?

Forgiveness training. ...is a combination of cognitive behavioral therapy & relaxation techniques, but the goals are the same: 1) Identify what the problem(s) is(are); 2) Work on relaxation techniques; 3) Challenge your own responses; 4) Change your thoughts from negative to positive. Ref. hopkinsmedicine.org.
See below. You are describing emotional eating - this is a problem that many suffer from. A combination of therapy and medications can help. The first step is to seek an evaluation - my office can help if you are local.
Stop & think. You are an emotional eater. When you feel sad or discouraged, try a fun activity instead of eating. Take a walk, a nap, read a magazine, or call a friend. Or, you can choose a healthy comfort food, like fruits and vegetables. Recognize when you are eating because you are hungry or because you are bored or sad. If you are not actually hungry, drink some water and try these other options.