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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Cache Config To Use TimeSpan #111

Merged
merged 8 commits into from
Aug 29, 2020
Merged

Conversation

JimBobSquarePants
Copy link
Member

@JimBobSquarePants JimBobSquarePants commented Aug 29, 2020

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 馃懏.
  • I have provided test coverage for my change (where applicable)

Description

Updates configuration to allow caching by any TimeSpan configuration. See #104

This is a necessary breaking change.

I've also reintroduced the samples webapp into the solution.

@JimBobSquarePants JimBobSquarePants requested a review from a team August 29, 2020 00:55
@codecov
Copy link

codecov bot commented Aug 29, 2020

Codecov Report

Merging #111 into master will decrease coverage by 0.22%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
- Coverage   82.89%   82.67%   -0.23%     
==========================================
  Files          44       44              
  Lines        1076     1068       -8     
  Branches      158      157       -1     
==========================================
- Hits          892      883       -9     
- Misses        136      137       +1     
  Partials       48       48              
Flag Coverage 螖
#unittests 82.67% <83.33%> (-0.23%) 猬囷笍

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage 螖
...Web/DependencyInjection/ImageSharpConfiguration.cs 100.00% <酶> (酶)
src/ImageSharp.Web/Middleware/ImageContext.cs 71.08% <50.00%> (-1.33%) 猬囷笍
.../ImageSharp.Web/Middleware/ImageSharpMiddleware.cs 78.00% <100.00%> (酶)
...harp.Web/Middleware/ImageSharpMiddlewareOptions.cs 53.84% <100.00%> (-3.85%) 猬囷笍

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update eec9fe8...054bc81. Read the comment docs.

Copy link
Member

@tocsoft tocsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think I would just make more sense to just have a single option called MaxCacheTimeout and it be of type TimeSpan instead of the now 3 separate parts it then allows for super fine grained adjustments without have to keep adding additional properties and having to then coherence the multiple fields into a TimeSpan anyway.

@JimBobSquarePants
Copy link
Member Author

Yeah, we'd have to determine a format though that can be parsed invariantly.

@tocsoft
Copy link
Member

tocsoft commented Aug 29, 2020

TimeSpans just work for serializing/parsing, if we are loading from app.configs anyway.

@tocsoft
Copy link
Member

tocsoft commented Aug 29, 2020

https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-timespan-format-strings

The invariant format looks like this 3.17:25:30.5000000 [d'.']hh':'mm':'ss['.'fffffff] so generally HH:MM:SS with optional days prefix and milliseconds postfix

@JimBobSquarePants
Copy link
Member Author

TimeSpans just work for serializing/parsing, if we are loading from app.configs anyway.

Beautiful. I'll make the changes.

@JimBobSquarePants JimBobSquarePants changed the title Add Additional Cache config Update Cache Config To Use TimeSpan Aug 29, 2020
@@ -74,7 +74,7 @@ jobs:
XUNIT_PATH: .\tests\ImageSharp.Web.Tests # Required for xunit

- name: Update Codecov
uses: codecov/codecov-action@v1.0.7
uses: codecov/codecov-action@v1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll have to do this in all our repos. They've changed things which causes a 400

Copy link
Member

@tocsoft tocsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much better 馃憤

@JimBobSquarePants JimBobSquarePants merged commit 3554640 into master Aug 29, 2020
@JimBobSquarePants JimBobSquarePants deleted the js/cache-config branch August 29, 2020 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants