Skip to content

Commit

Permalink
Change cache-time parameter
Browse files Browse the repository at this point in the history
+ log where cache is and cache-time
+ Update README.md
  • Loading branch information
Johnanater committed Oct 15, 2019
1 parent 93f6ce4 commit 28272bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion MinecraftAPI/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ public void ConfigureServices(IServiceCollection services)
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (int.TryParse(Configuration["cacheTime"], out int cacheTime))
// --cache-time=x
if (int.TryParse(Configuration["cache-time"], out int cacheTime))
Program.Instance.CacheTimeSeconds = cacheTime;

if (env.IsDevelopment())
{
Program.JsonUtils.CacheFile = $"../Cache/cache.json";
app.UseDeveloperExceptionPage();
}

Console.WriteLine($"Using cache @ {Program.JsonUtils.CacheFile}, cache time: {Program.Instance.CacheTimeSeconds} seconds...");

//app.UseHttpsRedirection();

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ Simple ASP.NET Core API for Minecraft skins

Parameters:
--url http://localhost:5000
Cache time in seconds: --cacheTime=1800
Cache time in seconds: --cache-time=1800

Running:

dotnet MinecraftAPI.dll
or
./MinecraftAPI

0 comments on commit 28272bb

Please sign in to comment.