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

Configurable Cache Expiration #229

Open
bekicot opened this issue Jun 13, 2022 · 1 comment
Open

Configurable Cache Expiration #229

bekicot opened this issue Jun 13, 2022 · 1 comment

Comments

@bekicot
Copy link

bekicot commented Jun 13, 2022

Currently, cache expiration is hard coded to 1 week.
This could be too long, or too short, depending application.

The feature of automatically refresh cache when the value is updated is great, but it may not work for multi node application.

@jwoodrow
Copy link

I'm not sure if my problem is linked to this issue, but I'm running into issues when combining the new version of the gem with parallel_tests.

I have defined a field for a minimal app version. But in the test meant to check the endpoint meant to provide this information it does not seem to update the value (or at least not the cache).

# In the Setting model
field :app_version, type: :string, default: '1.0'
# The spec that fails kind of randomely in CI using parallel_tests
before do
  Setting.app_version = '3.14'
end

it 'returns the latest version' do
  get :index # GET /app_version

  expect(JSON.parse(response.body).with_indifferent_access).to eq({ app_version: '3.14' })
end

And somehow (I don't know how to reproduce reliably) it fails saying the response actually returned { app_version: '1.0' }

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

No branches or pull requests

2 participants