-
Notifications
You must be signed in to change notification settings - Fork 0
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/mi 19 bigcommerce token and customer services #2
base: version/bigcommerce-1.1.0
Are you sure you want to change the base?
Feature/mi 19 bigcommerce token and customer services #2
Conversation
@brettcutt-aligent I see that you've previously implemented this as a |
@tvhees What you have in this PR looks good and follows along with the discussion of last weeks meeting. Ideally I would rather have |
import { sign } from 'jsonwebtoken'; | ||
|
||
// The default "customer_impersonation_token" query TTL should one not be stored in "CACHE_ITEMS_TTL" | ||
const QUERY_DEFAULT_TTL = CACHE_ITEMS_TTL?.[CACHE_KEY__CUSTOMER_IMPERSONATION_TOKEN] || 86400000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to set a fallback value if there's already one set in constants.ts
?``
const QUERY_DEFAULT_TTL = CACHE_ITEMS_TTL?.[CACHE_KEY__CUSTOMER_IMPERSONATION_TOKEN] || 86400000; | ||
|
||
// We time we extend the tokens' Time To Live (TTL) beyond the duration it's stored in the cache | ||
const QUERY_TTL_BUFFER_IN_MILLISECONDS = 10 * 60 * 1000; // minutes x seconds/min x ms/second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this live in constants.ts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR but it would be great if we could extract the xray logic into sub functions. I find the main caching logic is hard to read.
Provide services for the following operations commonly used in the mesh:
I have also: