feat(controller): restart the app if there is a failure.
feat(controller): fix flake8 error.
Merge pull request #2019 from aledbf/restart_app_on-failure

feat(controller): restart the app if there is a failure.