feat: analytics changes

This commit is contained in:
Nevo David 2026-01-21 16:01:02 +07:00
parent 2346223a04
commit 98a6fb1013
2 changed files with 8 additions and 7 deletions

View File

@ -109,12 +109,12 @@ export class PostsService {
}
}
const getIntegrationData = await ioRedis.get(
`integration:${orgId}:${post.id}:${date}`
);
if (getIntegrationData) {
return JSON.parse(getIntegrationData);
}
// const getIntegrationData = await ioRedis.get(
// `integration:${orgId}:${post.id}:${date}`
// );
// if (getIntegrationData) {
// return JSON.parse(getIntegrationData);
// }
try {
const loadAnalytics = await integrationProvider.postAnalytics(

View File

@ -366,7 +366,8 @@ export class PinterestProvider
date: number
): Promise<AnalyticsData[]> {
const today = dayjs().format('YYYY-MM-DD');
const since = dayjs().subtract(date, 'day').format('YYYY-MM-DD');
// Use a very long date range (2 years) to capture lifetime metrics for older posts
const since = dayjs().subtract(2, 'year').format('YYYY-MM-DD');
try {
// Fetch pin analytics from Pinterest API