When the drone flies, there is no issue.
When doing updates or tests with the drone, I'm keeping it cool by putting it outside my house, in a windy place. In the summer I'm avoiding doing it during hot part of the day.
When I have to keep the gimbal powered for prolonged time and near other equipment, ie. while fixing the Linux software part, I'm putting detached gimbal on a plastic covered ice block and surrounding it with towels. Plastic containers for ice were standard equipment with my fridge. This gives me around six hours before the ice melts.