In general, before loading or unloading any flammable liquids, an engine should be:

Before loading or unloading a tank with flammable liquids, you should turn off the engine, unless running the engine is necessary to operate a pump. Ground the tank before opening the filling hole and maintain the ground until after closing the filling hole.
DMV Writen Test