You cannot stop boredom setting in, it is a state of mind that happens when a thing or process becomes repetitive and boring, you cannot stop it, It just happens.
How you fight it is different for each of us, I just stop doing what makes a task boring, take a break and then come back to the task with a renewed sense of purpose, sometimes the break could last 5 or 10 mins, or it could be days or even weeks before I can face it.
Poker does have days when it seems to be hand after hand of rubbish, and because I only ever play for fun, and my living does not depend on it, I can leave it for days or weeks or even months if I had to.
When I was running a Poker League at my local pub, I hardly ever played on-line, as there is quite a bit of work behind the scenes, that players never see,registering new players to the League, updating League tables, organising transport for the qualifiers to the next Finals Venue, the list went on and on, this alone was why after 6 years of doing it without being paid I eventually gave it up. I needed a break.
When the fun Stops, STOP! (I stopped)