Skip to content

Commit 9610d9f

Browse files
committedDec 4, 2024
cleanup(api): removes old cache classes
1 parent 190e2bd commit 9610d9f

14 files changed

+0
-1025
lines changed
 

Diff for: ‎api/index.js

-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ validateEnvironmentVariables();
77
import { disconnect, prepareDatabaseConnection } from './db/knex-database-connection.js';
88
import { createServer } from './server.js';
99
import { config } from './src/shared/config.js';
10-
import { sharedUsecases as usecases } from './src/shared/domain/usecases/index.js';
1110
import { learningContentCache } from './src/shared/infrastructure/caches/learning-content-cache.js';
1211
import { temporaryStorage } from './src/shared/infrastructure/temporary-storage/index.js';
1312
import { logger } from './src/shared/infrastructure/utils/logger.js';
@@ -16,12 +15,6 @@ import { redisMonitor } from './src/shared/infrastructure/utils/redis-monitor.js
1615
let server;
1716

1817
async function _setupEcosystem() {
19-
/*
20-
Load learning content from Redis to memory cache can take some time
21-
Hence, we force this loading before the server starts so the requests can
22-
immediately be responded.
23-
*/
24-
await usecases.initLearningContentCache();
2518
/*
2619
First connection with Knex requires infrastructure operations such as
2720
DNS resolution. So we execute one harmless query to our database

Diff for: ‎api/src/shared/domain/usecases/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { fileURLToPath } from 'node:url';
33

44
import * as complementaryCertificationBadgeRepository from '../../../certification/complementary-certification/infrastructure/repositories/complementary-certification-badge-repository.js';
55
import * as badgeRepository from '../../../evaluation/infrastructure/repositories/badge-repository.js';
6-
import { LearningContentCache } from '../../infrastructure/caches/learning-content-cache.js';
76
import { injectDependencies } from '../../infrastructure/utils/dependency-injection.js';
87
import { importNamedExportsFromDirectory } from '../../infrastructure/utils/import-named-exports-from-directory.js';
98
const path = dirname(fileURLToPath(import.meta.url));
@@ -15,7 +14,6 @@ const usecasesWithoutInjectedDependencies = {
1514
const dependencies = {
1615
complementaryCertificationBadgeRepository,
1716
badgeRepository,
18-
LearningContentCache,
1917
};
2018

2119
const sharedUsecases = injectDependencies(usecasesWithoutInjectedDependencies, dependencies);

Diff for: ‎api/src/shared/domain/usecases/init-learning-content-cache.js

-3
This file was deleted.

Diff for: ‎api/src/shared/infrastructure/caches/Cache.js

-19
This file was deleted.

Diff for: ‎api/src/shared/infrastructure/caches/DistributedCache.js

-66
This file was deleted.

Diff for: ‎api/src/shared/infrastructure/caches/InMemoryCache.js

-65
This file was deleted.

Diff for: ‎api/src/shared/infrastructure/caches/LayeredCache.js

-42
This file was deleted.

Diff for: ‎api/src/shared/infrastructure/caches/RedisCache.js

-86
This file was deleted.

Diff for: ‎api/src/shared/infrastructure/caches/apply-patch.js

-10
This file was deleted.

Diff for: ‎api/tests/shared/unit/infrastructure/caches/Cache_test.js

-48
This file was deleted.

0 commit comments

Comments
 (0)