Skip to content

Commit

Permalink
Revert "BC-6040 - Redis Packages Update for Server and legacy client (#…
Browse files Browse the repository at this point in the history
…4641)"

This reverts commit 272bffe.
  • Loading branch information
dyedwiper committed Jan 23, 2024
1 parent 185bafc commit 5c5d9d2
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 384 deletions.
9 changes: 5 additions & 4 deletions apps/server/src/infra/cache/cache.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ import { Configuration } from '@hpi-schul-cloud/commons/lib';
import { CacheModule, CacheModuleOptions } from '@nestjs/cache-manager';
import { Module } from '@nestjs/common';
import { LegacyLogger, LoggerModule } from '@src/core/logger';
import { redisStore } from 'cache-manager-redis-yet';
import { create } from 'cache-manager-redis-store';
import { RedisClient } from 'redis';
import { CacheStoreType } from './interface';
import { CacheService } from './service/cache.service';

@Module({
imports: [
CacheModule.registerAsync({
useFactory: async (cacheService: CacheService, logger: LegacyLogger): Promise<CacheModuleOptions> => {
useFactory: (cacheService: CacheService, logger: LegacyLogger): CacheModuleOptions => {
if (cacheService.getStoreType() === CacheStoreType.REDIS) {
const redisUrl: string = Configuration.get('REDIS_URI') as string;
const store = await redisStore({ url: redisUrl });
const { client } = store;
const store = create({ url: redisUrl });
const client: RedisClient = store.getClient();

client.on('error', (error) => logger.error(error));
client.on('connect', (msg) => logger.log(msg));
Expand Down
Loading

0 comments on commit 5c5d9d2

Please sign in to comment.