Ignore:
Timestamp:
Jan 27, 2023, 7:28:00 PM (22 months ago)
Author:
alloc
Message:
  • Major refactoring
  • Using Utf8Json for (de)serialization
  • Moving APIs to REST
  • Removing dependencies from WebServer and MapRenderer to ServerFixes
Location:
binary-improvements2/WebServer/src/FileCache
Files:
1 deleted
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • binary-improvements2/WebServer/src/FileCache/AbstractCache.cs

    r392 r402  
    11using System.Collections.Generic;
    22
    3 namespace AllocsFixes.FileCache {
     3namespace Webserver.FileCache {
    44        public abstract class AbstractCache {
    55                public abstract byte[] GetFileContent (string _filename);
    6                 public abstract (int, int) Invalidate ();
     6                public abstract (int filesDropped, int bytesDropped) Invalidate ();
    77
    88                protected AbstractCache () {
     
    1616                       
    1717                        foreach (AbstractCache cache in caches) {
    18                                 (int, int) returned = cache.Invalidate ();
    19                                 filesDropped += returned.Item1;
    20                                 bytesDropped += returned.Item2;
     18                                (int files, int bytes) = cache.Invalidate ();
     19                                filesDropped += files;
     20                                bytesDropped += bytes;
    2121                        }
    2222
  • binary-improvements2/WebServer/src/FileCache/DirectAccess.cs

    r392 r402  
    22using System.IO;
    33
    4 namespace AllocsFixes.FileCache {
     4namespace Webserver.FileCache {
    55        // Not caching at all, simply reading from disk on each request
    66        public class DirectAccess : AbstractCache {
     
    99                                return File.Exists (_filename) ? File.ReadAllBytes (_filename) : null;
    1010                        } catch (Exception e) {
    11                                 Log.Out ("Error in DirectAccess.GetFileContent: " + e);
     11                                Log.Out ($"Error in DirectAccess.GetFileContent: {e}");
    1212                        }
    1313
  • binary-improvements2/WebServer/src/FileCache/InvalidateCachesCmd.cs

    r397 r402  
    22using JetBrains.Annotations;
    33
    4 namespace AllocsFixes.FileCache {
     4namespace Webserver.FileCache {
    55        [UsedImplicitly]
    66        public class InvalidateCachesCmd : ConsoleCmdAbstract {
  • binary-improvements2/WebServer/src/FileCache/SimpleCache.cs

    r392 r402  
    33using System.IO;
    44
    5 namespace AllocsFixes.FileCache {
     5namespace Webserver.FileCache {
    66        // Caching all files, useful for completely static folders only
    77        public class SimpleCache : AbstractCache {
     
    2424                                }
    2525                        } catch (Exception e) {
    26                                 Log.Out ("Error in SimpleCache.GetFileContent: " + e);
     26                                Log.Out ($"Error in SimpleCache.GetFileContent: {e}");
    2727                        }
    2828
Note: See TracChangeset for help on using the changeset viewer.