look at the oil sender, it may have more than 1 sender in a tee fitting. you may have a 'low oil pressure' shut off circuit, and you either don't have enough oil pressure at idle to keep the sender circuit 'closed', or the sender has gotten to a point that it needs more oil pressure than you have. also check the oil pressure with a gauge.
The sender with 1 wire will be for the dash light or gauge, the sender with 2 or 3 wires will be a "Murphy switch-sender".
This is ONLY to be used to report flooding, spam, advertising and problematic (harassing, abusive or crude) posts.