7. Violations and penalties. Any retailer who violates any provision of this section, or any rule or regulation promulgated hereunder, shall be liable to the people of the state for a civil penalty of up to one thousand five hundred dollars per day for every such violation, to be assessed by the commissioner, after a hearing or opportunity to be heard upon due notice and with the right to representation by counsel. In determining the amount of civil penalty, the commissioner shall take into consideration mitigating factors, such as the availability of gasoline at the retail outlet, provided that the retailer did not refuse such delivery, and the extent to which the retailer's action or inaction contributed to the violation. Such penalty may be recovered in an action brought by the attorney general at the request and in the name of the commissioner in any court of competent jurisdiction. Such civil penalty may be released or compromised by the commissioner before the matter has been referred to the attorney general. Additionally, after such hearing and a finding that such retailer has violated the provisions of this section, or of any rule or regulation promulgated thereunder, the commissioner may issue and cause to be served upon such person an order enjoining such person from violating such provisions and taking all necessary actions for such person to come into compliance with such provisions. Any such order of the commissioner may be enforced in an action brought by the attorney general at the request and in the name of the commissioner in any court of competent jurisdiction Notwithstanding the foregoing, such retailer shall not be in violation of subdivision three of this section if he or she is unable to deploy, install or operate an alternate generated power source because of uncontrollable circumstances, including but not limited to, restrictions imposed by public safety officers to address an emergency situation or that such retail station is made unsafe or unable to operate due to acts of God, fires, floods, explosions or the safety of personnel needed to operate such retail outlet. Additionally, such retailer shall not be in violation of subdivision three of this section if he or she is a participant in the program established under subdivision twenty-one of section eighteen hundred fifty-four of the public authorities law and a generator is not provided to the retailer due to the prioritization allowed under such subdivision or through no fault of the retailer.