开发者

Google App Engine - Is there a way to get some sort of current time that would be consistent across instances of my app

开发者 https://www.devze.com 2022-12-26 09:34 出处:网络
If I call new Date() it will get the current time for the machine my app is running on. I\'m assuming that the machines on the Google App Engine do not all have their time synchronized.

If I call new Date() it will get the current time for the machine my app is running on.

I'm assuming that the machines on the Google App Engine do not all have their time synchronized.

Is there a way to get a time that would be consistent across instances of my app that may be running on different mach开发者_如何学Goines?


No. Machines are NTP synchronized, so they will be within a few milliseconds of each other, but there's no way to get a global monotonic counter on App Engine. This is because the only way to do so requires a single authority, and is thus not a scalable solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消