Many people worry about loss of data on their computers in the event of a power outage, but there’s another threat to keep an eye out for the next time the power goes out. Think about the fact that your refrigerator relies on electricity to keep running, and if the power goes out, all of your perishable foods and beverages are in danger of going bad.

The question, how long do you have before it’s a serious problem? A few minutes should be fine. In fact, even a few hours probably won’t hurt. Once you get past four to six hours, though, the safest thing to do is throw out every perishable item in your refrigerator. As painful as that might be to your wallet, it’s not as painful as food poisoning or serious illness would be to you.

Of course, this applies only if you don’t open the door. If you do, then you’ve let out the lingering cool air and accelerated the process of thawing and spoiling. Fortunately, even though your perishable goods, such as fruits and vegetables, can’t go more than four to six hours without spoiling, milk is a bit of a different story.

With milk, you could conceivably get up to 48 hours before if it’s in the freezer and the freezer is full. The reason is because everything packed close together can keep the cold contained. If your freezer is only half full or less, then you won’t be able to get more than 24 hours out of the milk before it spoils. That’s the rule of thumb, and whenever possible, it’s best to err on the side of caution.

Of course, if you have dry ice or a milk cooler handy, you might be able to extend its lifespan much longer. Generally, for every five degrees the temperature of milk rises beyond 40 degrees, its shelf life is halved. It always helps to be prepared, just in case.