Taylor Curran
04/03/2023, 1:58 PMMarvin
04/03/2023, 1:59 PMtimeout_seconds
keyword argument and is measured in seconds. If a task exceeds the duration, a timeout exception will be raised and it will be marked as failed, so this is a useful feature to keep your flows running efficiently! The timeout feature is deprecated as of February 2023, and users should use the PREFECT_API_DATABASE_MIGRATE_ON_START
instead. You can find more information about this feature in the [Prefect Docs](https://docs.prefect.io/concepts/tasks/) and the [prefect.settings Prefect Docs](https://docs.prefect.io/api-ref/prefect/settings/).PREFECT_API_DATABASE_MIGRATE_ON_START
feature is a better way to determine if a task is hung or not, so it is the recommended approach going forward. That said, I understand if you are familiar with the timeout feature and would like to stick with that, since it may still work in some cases. But, I would recommend looking into the PREFECT_API_DATABASE_MIGRATE_ON_START
to get the most out of Prefect.Taylor Curran
04/03/2023, 2:17 PMPREFECT_API_DATABASE_MIGRATE_ON_START
feature from Prefect?Marvin
04/03/2023, 2:17 PMPREFECT_API_DATABASE_MIGRATE_ON_START
feature from Prefect is a setting that determines if the database should be upgraded upon application creation. If set to True
, the database will be upgraded on application creation and if set to False
, the database will need to be upgraded manually.
It's important to note that this feature is the replacement for the previously deprecated PREFECT_ORION_DATABASE_MIGRATE_ON_START
setting. It is also a module-attribute setting and the CLI interface has been updated to include new commands and revise an existing command to leverage these migrations. The commands are as follows: prefect orion reset-db
is now prefect orion database reset
, prefect orion database upgrade
runs upgrade migrations, and prefect orion database downgrade
runs downgrade migrations.
For more information about this feature and the other features from Prefect, you can refer to the [Prefect Docs](https://docs.prefect.io/concepts/tasks/) and the [prefect.settings Prefect Docs](https://docs.prefect.io/api-ref/prefect/settings/). You can also check out the release notes for the various Prefect versions in their [GitHub repository](https://github.com/PrefectHQ/prefect/blob/main/RELEASE-NOTES.md).
I hope this answers your question. Let me know if you need any more information.