If you google up his poll numbers you'll see that apparently he had little chance of winning re-election.
From August 3rd...
"If the 2018 midterm election were held today, just 31 percent of respondents said they would support Flake's bid, compared to 47 percent who said they would support a generic Democratic opponent, according to the poll."