def wait_for_db_start()

in composer_local_dev/environment.py [0:0]


    def wait_for_db_start(self):
        start_time = time.time()
        with console.get_console().status("[bold green]Starting database..."):
            self.assert_container_is_active(self.db_container_name)
            for line in self.get_container(self.db_container_name).logs(stream=True, timestamps=True):
                line = line.decode('utf-8').strip()
                console.get_console().print(line)
                if "database system is ready to accept connections" in line:
                    start_duration = time.time() - start_time
                    LOG.info("Database is started in %.2f seconds", start_duration)
                    return
                if timeout_occurred(start_time):
                    raise errors.EnvironmentStartTimeoutError()
                self.assert_container_is_active(self.db_container_name)
        raise errors.EnvironmentStartError()