服务器空闲并再次启动后存储在 Heroku 应用程序上的信息丢失了吗?

Information stored on Heroku Application lost after server goes idle and starts up again?

我正在将一些信息保存到存储在我的 Heroku 应用程序中的文本文件中。它可以通过使用 IOS 设备的用户的 post 请求进行更新。一切正常,它存储信息。但是众所周知,Heroku 应用程序在一个小时后就闲置了。所以在服务器空闲并且我发出GET请求后,之前输入的信息丢失了?

我的 heroku 应用程序中有一个 link,例如 afternoon-springs.... /ResetAllInfo,但从未访问过 link。我看了heroku日志才知道。

有什么想法吗?

Heroku 似乎不支持写入文件系统:Heroku Documentation and here:

Each dyno gets its own ephemeral filesystem, with a fresh copy of the most recently deployed code. During the dyno’s lifetime its running processes can use the filesystem as a temporary scratchpad, but no files that are written are visible to processes in any other dyno and any files written will be discarded the moment the dyno is stopped or restarted.

所以这是不可能的。 Heroku 建议:

Use the provided PostgreSQL database instead of a filesystem database