Giter Site home page Giter Site logo

Comments (2)

will3216 avatar will3216 commented on August 24, 2024

Based on your example, it might be the difference between using a string vs a symbol?

from feature.

alexeymorozov avatar alexeymorozov commented on August 24, 2024

Do you use 'Feature-toggle caching' with a number as a second argument?

Feature.set_repository(your_repository, 60)

If yes, it could happen because #run_with_activated doesn't flush @next_refresh_after:

  def self.run_with_activated(*features, &blk)
    with_stashed_config do
      @active_features.concat(features).uniq!
      @auto_refresh = false
      @perform_initial_refresh = false
      blk.call
    end
  end

And #active_features refreshes features from a repo:

  def self.active_features
    raise 'missing Repository for obtaining feature lists' unless @repository

    refresh! if @auto_refresh || @perform_initial_refresh || (@next_refresh_after && Time.now > @next_refresh_after)

    @active_features
  end

  def self.refresh!
    @active_features = @repository.active_features
    @next_refresh_after = Time.now + @refresh_after if @refresh_after
    @perform_initial_refresh = false
  end

There is another condition for a bug to be reproduced:

  • specs should be executed for more than @refresh_time
  • or spring should be started before (Time.now - @refresh_time).

Both easily happen if @refresh_time is pretty small.

from feature.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.