Skip to content

Commit 98a6fb1

Browse files
committed
feat: analytics changes
1 parent 2346223 commit 98a6fb1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

libraries/nestjs-libraries/src/database/prisma/posts/posts.service.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ export class PostsService {
109109
}
110110
}
111111

112-
const getIntegrationData = await ioRedis.get(
113-
`integration:${orgId}:${post.id}:${date}`
114-
);
115-
if (getIntegrationData) {
116-
return JSON.parse(getIntegrationData);
117-
}
112+
// const getIntegrationData = await ioRedis.get(
113+
// `integration:${orgId}:${post.id}:${date}`
114+
// );
115+
// if (getIntegrationData) {
116+
// return JSON.parse(getIntegrationData);
117+
// }
118118

119119
try {
120120
const loadAnalytics = await integrationProvider.postAnalytics(

libraries/nestjs-libraries/src/integrations/social/pinterest.provider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ export class PinterestProvider
366366
date: number
367367
): Promise<AnalyticsData[]> {
368368
const today = dayjs().format('YYYY-MM-DD');
369-
const since = dayjs().subtract(date, 'day').format('YYYY-MM-DD');
369+
// Use a very long date range (2 years) to capture lifetime metrics for older posts
370+
const since = dayjs().subtract(2, 'year').format('YYYY-MM-DD');
370371

371372
try {
372373
// Fetch pin analytics from Pinterest API

0 commit comments

Comments
 (0)