-
Isn't checking if CreatedDate >= 4 hours ago redundant to checking it CreatedDate is today? The only gap I can see is if it is 1am, this will only pull the records created from midnight to 1am instead of the last 4 hours. Is there value in that? Doesn't this mean there is a gap in the setStatusApiDetails() method where if that is not called at the end of the day, there are records that might miss getting their API release number & version getting set? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi @rmccu - the gap that you're referring to is exactly the goal of this. My intent is for the code to make the callout at least once per 24 hours to ensure that the API details (retrieved via the callout) are accurate. At one point, the code only used |
Beta Was this translation helpful? Give feedback.
-
@jongpie Fair point on the lack of platform cache. Maybe an optional flag? While I get that this is running async, so there is less earnestness in ensuring it is performant, it still consumes system resources, which affect overall system responsiveness. While this query is using an index, I am still curious how big of a DB impact it has. We have 60k users (with more being brought on board every few weeks). Some of this logging was added due to a web-mashup integration we have with another system where we are using the JavaScript postMessage() method and listeners so that the 2 windows can speak to one another. This integration has been problematic and in order to prove the source of the issue was not in Salesforce, we had to add a lot of logging of each step of the integration so that we could show that the 3rd party system was too unstable and not receiving all of our messages. There are additional entries coming from our integrations to the OpenCTI adapter, and we have some integrations that run when we "pop" our C360 experience and try to determine if the customer information has been populated from the back-end systems. |
Beta Was this translation helpful? Give feedback.
Hi @rmccu - the gap that you're referring to is exactly the goal of this. My intent is for the code to make the callout at least once per 24 hours to ensure that the API details (retrieved via the callout) are accurate. At one point, the code only used
WHERE CreatedDate >= :fourHoursAgo
, which caused problems in some larger orgs with ongoing logging. In these orgs, there were scheduled jobs running hourly, so there was always 1+Log__c
created within the last 4 hours. As a result,LogEntryEventHandler
would continue to use a queriedLog__c
record - the callout wasn't executed for a while (a few weeks, if I remember correctly), resulting in stale data. By changing the query toWHERE Create…