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

[ADDED] FileStore: auto sync interval #882

Merged
merged 1 commit into from
Jul 16, 2019
Merged

Conversation

kozlovic
Copy link
Member

Added ability to have the store auto flush/sync stores at regular
interval. This can be useful if one wants to disable sync at every
Flush() but still wants to have files being sync'ed from time to
time.

Signed-off-by: Ivan Kozlovic ivan@synadia.com

Added ability to have the store auto flush/sync stores at regular
interval. This can be useful if one wants to disable sync at every
Flush() but still wants to have files being sync'ed from time to
time.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 91.864% when pulling 30afcc4 on add_file_auto_sync into fd8baca on master.

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kozlovic kozlovic merged commit 196a4a3 into master Jul 16, 2019
@kozlovic kozlovic deleted the add_file_auto_sync branch July 16, 2019 15:23
kozlovic added a commit that referenced this pull request Jul 22, 2019
The original implementation was having a central timer routine
that would go through the list of channels (interface) and cast
them to FileMsgStore and FileSubStore to invoke the stores' autoSync()
functions.
However, with stores that wrap a FileStore instance (such as RAFT or
Crypto store), that would cause a panic since the casting would fail.

Alternative fix would have been for FileStore to maintain a separate
map of actual File[Msg/Sub]Store, but I chose instead to move the
call to autoSync() into the Msg/Sub stores themselves.

Relates to #882

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
kozlovic added a commit that referenced this pull request Jul 22, 2019
The original implementation was having a central timer routine
that would go through the list of channels (interface) and cast
them to FileMsgStore and FileSubStore to invoke the stores' autoSync()
functions.
However, with stores that wrap a FileStore instance (such as RAFT or
Crypto store), that would cause a panic since the casting would fail.

Alternative fix would have been for FileStore to maintain a separate
map of actual File[Msg/Sub]Store, but I chose instead to move the
call to autoSync() into the Msg/Sub stores themselves.

Relates to #882

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
kozlovic added a commit that referenced this pull request Jul 22, 2019
The original implementation was having a central timer routine
that would go through the list of channels (interface) and cast
them to FileMsgStore and FileSubStore to invoke the stores' autoSync()
functions.
However, with stores that wrap a FileStore instance (such as RAFT or
Crypto store), that would cause a panic since the casting would fail.

Alternative fix would have been for FileStore to maintain a separate
map of actual File[Msg/Sub]Store, but I chose instead to move the
call to autoSync() into the Msg/Sub stores themselves.

Relates to #882

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
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.

3 participants