"An" is okay in both sentences, with approximately the same meaning. There is the very subtlest difference in sense, however. With "the," the sentence is more formal and unfriendly-sounding.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.