(root)/ – Rev 37801
Rev 37800 |
Last modification |
Compare with Previous |
View Log
| RSS feed
Last modification
- Rev 37801 2026-09-28 20:06:30
- Author: amit
- Log message:
- Disable Pine Labs offer discovery behind a config switch (default off)
Turns off the live Pine Labs per-item offer discovery on the user's
instruction. New pinelabs.offer.discovery.enabled, default FALSE, so the
integration is off in every environment unless a properties file opts in.
Gated at the single point all discovery funnels through
(PinelabsAffordabilityServiceImpl.discoverOffers), so one switch stops the
nightly cache loop, a single-item refresh and the /pinelabs/offers endpoint
without editing the six call sites. discoverOffersRawJson gated too.
cacheAllItemOffers returns before its listing query, since the loop costs
4,507 items and ~12 minutes of a cron thread even when every call is a no-op.
Degrades gracefully rather than breaking the product surface: an empty
OfferDiscoveryResponse is exactly what the existing catch block returns, and
getGroupedCachedOffersForItems already drops an entry with an empty issuer
map. The Redis cache is a 24h TTL, so live badges drain within a day rather
than vanishing mid-request.
The @Value carries a default deliberately — pinelabs.api.base.url and the
credentials carry none, so a missing key stops the whole context (the r37495
class of outage). A kill switch must never be able to do that.
SCOPE: offer discovery ONLY. Payment-gateway traffic (orders, refunds,
callbacks, webhooks) and offer create/validate/downpayment are untouched,
so no live money path changes behaviour.
@Scheduled on ScheduledSkeleton.fetchOffersByItem is intentionally left in
place — with the flag off it is one log line, and re-enabling stays a config
change rather than a code change.
Build: dao + web + cron + fofo compile, BUILD SUCCESSFUL.