* chore: implement redis cache for calendars api v2 * fixup! chore: implement redis cache for calendars api v2 * fixup! fixup! chore: implement redis cache for calendars api v2 * fix leverage genetic type of redis.get * refactor: address supalarry's PR feedback - Create CalendarsCacheService to separate cache responsibilities - Rename cache methods to be more descriptive (getConnectedAndDestinationCalendarsCache, setConnectedAndDestinationCalendarsCache) - Remove unused redisService injection from CalendarsController - Move all cache-related functionality to dedicated service Addresses comments 9, 10, and 11 from supalarry on PR #23622 Co-Authored-By: morgan@cal.com <morgan@cal.com> * refactor: address supalarry's latest PR feedback - Remove redundant deleteConnectedAndDestinationCalendarsCache from CalendarsService - Update controller to directly inject and use CalendarsCacheService - Extract TTL constant and remove manual JSON.stringify in cache service Co-Authored-By: morgan@cal.com <morgan@cal.com> * fix: update IcsFeedService to use CalendarsCacheService directly - Inject CalendarsCacheService into IcsFeedService constructor - Replace calendarsService.deleteCalendarCache with calendarsCacheService.deleteConnectedAndDestinationCalendarsCache - Completes the refactoring to eliminate all old cache method references Co-Authored-By: morgan@cal.com <morgan@cal.com> * fix: update destination-calendars and selected-calendars services to use CalendarsCacheService directly - Inject CalendarsCacheService in both service constructors - Replace calendarsService.deleteCalendarCache calls with calendarsCacheService.deleteConnectedAndDestinationCalendarsCache - Add CalendarsCacheService to module providers for proper dependency injection - Completes migration of all cache method references to use dedicated cache service Co-Authored-By: morgan@cal.com <morgan@cal.com> * chore: use CalendarsCacheService --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
38 lines
2.0 KiB
TypeScript
38 lines
2.0 KiB
TypeScript
import { CalendarsRepository } from "@/ee/calendars/calendars.repository";
|
|
import { CalendarsCacheService } from "@/ee/calendars/services/calendars-cache.service";
|
|
import { CalendarsService } from "@/ee/calendars/services/calendars.service";
|
|
import { AppsRepository } from "@/modules/apps/apps.repository";
|
|
import { CredentialsRepository } from "@/modules/credentials/credentials.repository";
|
|
import { OrganizationsDelegationCredentialRepository } from "@/modules/organizations/delegation-credentials/organizations-delegation-credential.repository";
|
|
import { OrganizationsMembershipRepository } from "@/modules/organizations/memberships/organizations-membership.repository";
|
|
import { OrganizationsMembershipOutputService } from "@/modules/organizations/memberships/services/organizations-membership-output.service";
|
|
import { OrganizationsMembershipService } from "@/modules/organizations/memberships/services/organizations-membership.service";
|
|
import { PrismaModule } from "@/modules/prisma/prisma.module";
|
|
import { RedisModule } from "@/modules/redis/redis.module";
|
|
import { SelectedCalendarsController } from "@/modules/selected-calendars/controllers/selected-calendars.controller";
|
|
import { SelectedCalendarsRepository } from "@/modules/selected-calendars/selected-calendars.repository";
|
|
import { SelectedCalendarsService } from "@/modules/selected-calendars/services/selected-calendars.service";
|
|
import { UsersRepository } from "@/modules/users/users.repository";
|
|
import { Module } from "@nestjs/common";
|
|
|
|
@Module({
|
|
imports: [PrismaModule, RedisModule],
|
|
providers: [
|
|
SelectedCalendarsRepository,
|
|
CalendarsRepository,
|
|
CalendarsService,
|
|
CalendarsCacheService,
|
|
UsersRepository,
|
|
CredentialsRepository,
|
|
AppsRepository,
|
|
OrganizationsMembershipService,
|
|
OrganizationsMembershipOutputService,
|
|
OrganizationsDelegationCredentialRepository,
|
|
OrganizationsMembershipRepository,
|
|
SelectedCalendarsService,
|
|
],
|
|
controllers: [SelectedCalendarsController],
|
|
exports: [SelectedCalendarsRepository],
|
|
})
|
|
export class SelectedCalendarsModule {}
|