cleanUp

abstract suspend fun cleanUp()(source)

Clean up any old state/data that was migrated into the DataStore. This will not be called if the migration fails. If cleanUp throws an exception, the exception will be propagated back to the DataStore call that triggered the migration and future calls to DataStore will result in DataMigrations being attempted again. This method may be run multiple times when any failure is encountered.

This is useful for cleaning up files or data outside of DataStore and accessing any data from DataStore directly from inside this function will result in deadlock, since DataStore doesn't return data until all migrations complete.