rename force -> skipCache

This commit is contained in:
tobi 2025-01-07 17:46:29 +01:00
parent 175107f6a3
commit 203d2b79a3
2 changed files with 5 additions and 5 deletions

View File

@ -235,8 +235,8 @@ func (s *Subscriptions) ProcessDomainPermissionSubscription(
// going to attempt this now. // going to attempt this now.
permSub.FetchedAt = time.Now() permSub.FetchedAt = time.Now()
// Call the URI, only force // Call the URI, and only skip
// if we're doing a dry run. // cache if we're doing a dry run.
resp, err := tsport.DereferenceDomainPermissions( resp, err := tsport.DereferenceDomainPermissions(
ctx, permSub, dry, ctx, permSub, dry,
) )

View File

@ -44,7 +44,7 @@ type DereferenceDomainPermissionsResp struct {
func (t *transport) DereferenceDomainPermissions( func (t *transport) DereferenceDomainPermissions(
ctx context.Context, ctx context.Context,
permSub *gtsmodel.DomainPermissionSubscription, permSub *gtsmodel.DomainPermissionSubscription,
force bool, skipCache bool,
) (*DereferenceDomainPermissionsResp, error) { ) (*DereferenceDomainPermissionsResp, error) {
// Prepare new HTTP request to endpoint // Prepare new HTTP request to endpoint
req, err := http.NewRequestWithContext(ctx, "GET", permSub.URI, nil) req, err := http.NewRequestWithContext(ctx, "GET", permSub.URI, nil)
@ -63,9 +63,9 @@ func (t *transport) DereferenceDomainPermissions(
req.Header.Add("Accept-Charset", "utf-8") req.Header.Add("Accept-Charset", "utf-8")
req.Header.Add("Accept", permSub.ContentType.String()+","+"*/*") req.Header.Add("Accept", permSub.ContentType.String()+","+"*/*")
// If force is true, we want to skip setting Cache // If skipCache is true, we want to skip setting Cache
// headers so that we definitely don't get a 304 back. // headers so that we definitely don't get a 304 back.
if !force { if !skipCache {
// If we've successfully fetched this list // If we've successfully fetched this list
// before, set If-Modified-Since to last // before, set If-Modified-Since to last
// success to make the request conditional. // success to make the request conditional.