About a year after I first started growing in the tiny space that I have, I ended up getting both pests pretty regular. They go away, and come back on the wind, or with soil. Spider mites as far as I know like it hot and dry. So you should make the grow room cool and humid. Unfortunately this makes it a slightly better environment for fungus gnats. For fungus gnats in a closed space, I have been using the carnivorous plant known as the cape sundew. Fungus gnats are drawn to it like a magnet and are devoured almost instantly. All one needs is peat moss and rain water to grow a sundew. To kill spider mites I have had a lot of success with oil. I tested rosemary oil and ivory dish soap on spider mites and on two inch long green caterpillars and it killed them both. The spray I have come up with though is actually neem oil and rosemary oil together. Smells like pinesol. In one quart of water, add a few drops of ivory soap. Measure out 1ml of both rosemary oil and neem oil and mix well with your one quart of soapy water. Mix very well, and if there are no suds you might want to add a tiny bit more soap. You may want to trim your vegging plants down to a smaller size to help with the amount of spraying you will need to do. As far as flowering plants, if they are late in flower, as in, they have some pistils turning brown, you're better off waiting for the next grow. But early on in flower you can spray for mites but try not to soak the flowers themselves. At too high concentrations of rosemary and neem oil you can burn your plants leaves. Be careful to not use more than 4ml of oil per quart of water or you could severely extend the time it takes the plants to recover from the infestation and the spraying. Plants do not enjoy wet leaves. To dry off your plants place them back in your [cleaned] grow room with the lights off but ventilation on.