def loop_main_task()

in greengrass-v2/poll-api/artifacts/com.greengrass.GGUtils/1.0.0/GGUtils.py [0:0]


    def loop_main_task(self):
        config = self.get_configuration()

        try:
            self.main_task(config)
        except Exception as e:
            log_exception(e, "Exception while running the main task")

        # If there is an error or the main task exits, we need to restart the thread with the existing configuration
        self.SCHEDULED_THREAD = Timer(
            # Run again in the specified number of seconds or default to 10 seconds
            float(config.get(POLL_INTERVAL_SECS, 10)),
            self.loop_main_task
        )

        self.SCHEDULED_THREAD.start()