Giter VIP home page Giter VIP logo

net.distributedfilestorecache's People

Contributors

jonpsmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

net.distributedfilestorecache's Issues

Fails after about 10 entries

I started using this in my project, and initial testing went well. Then, I realised that only few values were stored in the cache.

I then created the following test (NUnit) to verify whether the IDistributedFileStoreCacheClass was working fine:

namespace Caching
{
    public class CachingTests
    {
        IDistributedFileStoreCacheClass fileCache;

        [OneTimeSetUp]
        public void FileCacheSetup()
        {
            var services = new ServiceCollection();

            //services.AddTransient<IMatchRepository, MatchRepositoryStub>(); // another example of adding service

            services.AddDistributedFileStoreCache(options =>
            {
                options.WhichVersion = FileStoreCacheVersions.Class;
                options.SecondPartOfCacheFileName = "CachingTests";
                options.PathToCacheFileDirectory = @"C:\temp";
            });

            var serviceProvider = services.BuildServiceProvider();

            fileCache = serviceProvider.GetService<IDistributedFileStoreCacheClass>();

            fileCache.ShouldNotBeNull();
        }

        [TestCase(1)]
        [TestCase(5)]
        [TestCase(10)]
        [TestCase(20)]
        [TestCase(50)]
        [TestCase(100)]
        [TestCase(500)]
        [TestCase(1000)]
        [TestCase(10000)]
        public void FileCacheTest_ManyEntries(int length)
        {
            List<string> keys = new();
            Random random = new Random(0);
            for (int i = 0; i < length; i++)
            {
                var data = AutoBogus.AutoFaker.Generate<NominatimData>();
                string key = $"{random.Next()}";
                keys.Add(key);
                fileCache.SetClass(key, data);
            }

            foreach (var key in keys)
            {
                var fromCache = fileCache.GetClass<NominatimData>(key);
                fromCache.ShouldNotBeNull();
            }
        }
    }
}

This passes for the first TestCase values (until 10, inclusive) but for higher numbers it fails on fromCache.ShouldNotBeNull(). The values are not written to the file anymore after about 10 values.

How to configure it for AWS Load Balancer.

Can you please guide me a little that, how to configure it for AWS Load Balancer? Because the JSON file needs to keep a central place so it can be accessed by each instance.

Using with Kubernetes Persistent Volume

First of, nice lib ๐Ÿ‘

I trying to use this with Kubernetes using a Persistent Volume for storage. The basics are working - the cache file is updated. However updates does not seem to get propagated to the other instances. I'm guessing it is FileSystemWatcher that does work.

Do you have experience using the lib in Kubernetes?

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.