It takes about 1 - 2 weeks for the GI tract to recover 100%, but I don't think that is the issue. I think that he is eating all kinds of stuff continually throughout the day. So cut out all snacks for a few days, and just feed him 2 - 3 times at his regular meals, only. When his feeding times are regular, his digestion should be regular. As soon as he's back to normal, you can resume the treats.
If you are using the treats for training, use less for now... just a taste rather than a full snack.
If you are using the treats for training, use less for now... just a taste rather than a full snack.