Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for reading offset from a file #9

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Qvazar
Copy link

@Qvazar Qvazar commented Apr 30, 2019

To implement a use case of a Java application running in Kubernetes, I needed to be able to dynamically set the time offset from outside the Java process.
Every time System.currentTimeMillis() is called, the offset is now read from the file specified in the Java property faketime.offset.file instead of directly from the property faketime.offset.seconds. If the property is not set, the offset in faketime.offset.seconds is used as before.

This enables one to dynamically set the offset in a Kubernetes ConfigMap object, which is mounted in the Java application container as a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant