File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1- # replace ghp_example with your GitHub PAT token
1+ # replace ghp_example with your GitHub PAT token (see README for instructions)
22TOKEN = ghp_example
3+
4+ # optional: Add a comma-separated list of GitHub usernames to whitelist (only these users' streaks will be displayed)
5+ # WHITELIST=DenverCoder1
6+
7+ # optional: disable caching (not recommended, may cause rate limit issues)
8+ # DISABLE_CACHE=true
Original file line number Diff line number Diff line change 4646 "exclude_days " => $ excludeDaysRaw ,
4747 ];
4848
49- // Check for cached stats first (24 hour cache)
50- $ cachedStats = getCachedStats ($ user , $ cacheOptions );
49+ // Check if cache is disabled
50+ $ useCache = !isset ($ _SERVER ["DISABLE_CACHE " ]) || strtolower ($ _SERVER ["DISABLE_CACHE " ]) !== "true " ;
51+
52+ // Check for cached stats first (24 hour cache) unless cache is disabled
53+ $ cachedStats = $ useCache ? getCachedStats ($ user , $ cacheOptions ) : null ;
5154
5255 if ($ cachedStats !== null ) {
5356 // Use cached stats - instant response!
6568 $ stats = getContributionStats ($ contributions , $ excludeDays );
6669 }
6770
68- // Cache the stats for 24 hours
69- setCachedStats ($ user , $ cacheOptions , $ stats );
71+ // Cache the stats for 24 hours unless cache is disabled
72+ if ($ useCache ) {
73+ setCachedStats ($ user , $ cacheOptions , $ stats );
74+ }
7075 }
7176
7277 renderOutput ($ stats );
You can’t perform that action at this time.
0 commit comments