The sheriff or the director of development services, or their designees, may immediately close an establishment operated pursuant to a license under this article in case of an emergency, for the safety of the public or to investigate a crime for a period of time not to exceed 24 hours, or for such longer period of time as law enforcement officials may reasonably require to complete a criminal investigation at the establishment.