perf: optimize widget integration requests
This commit is contained in:
1 parent
f65969053a
commit
dcef36ffa7
14 files changed
+517
-48
No files matched your search
@@ -11,9 +11,13 @@ export const mediaRequestStatsRequestHandler = createIntegrationRequestHandler<
|
||||
>({
|
||||
async requestAsync(integration, _input) {
|
||||
const integrationInstance = await createIntegrationAsync(integration);
|
||||
const [stats, users] = await Promise.all([
|
||||
integrationInstance.getStatsAsync(),
|
||||
integrationInstance.getUsersAsync(),
|
||||
]);
|
||||
return {
|
||||
stats: await integrationInstance.getStatsAsync(),
|
||||
users: await integrationInstance.getUsersAsync(),
|
||||
stats,
|
||||
users,
|
||||
};
|
||||
},
|
||||
cacheTtlMs: 60_000,
|
||||
|
||||
Reference in new issue
Block a user