问题
I published a project in Heroku. The text file in my project is reset every 24 hours, all data in it is lost. How do I solve the problem?
回答1:
You cannot.
Heroku Dynos restart every 24 hours and any file change is discarded (see Heroku ephemeral filesystem)
If you need to persist data you can use a DB (ie Postgres) or a remote storage (ie Amazon S3)
来源:https://stackoverflow.com/questions/65552892/heroku-resets-the-text-file-in-my-project-every-24-hours