If the ruler’s temper flares against you, do not abandon your post, for calmness lays great offenses to rest.
The scope of these verses is to keep subjects loyal and dutiful to the government. In Solomon's reign the people were very rich, and lived in prosperity, which perhaps made them proud and petulant, and when the taxes were high, though they had enough to pay them with, it is probable that many conducted themselves insolently towards the government and threatened to rebel.
Commenting on Ecclesiastes 10:4-11
If the spirit of the ruler rise up against thee,.... The wrath of the civil magistrate, the chief ruler of the land, the sovereign prince or king, to whom men are and should be subject: if his wrath on any occasion breaks out in a furious manner, and, like a storm and tempest, is very blustering and threatening: leave not thy place; at court; thine...
spirit--anger. yielding pacifieth-- (Pro 15:1). This explains "leave not thy place"; do not in a resisting spirit withdraw from thy post of duty (Ecc 8:3).