Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
chore: update cache system to lru-cache (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulkr authored Aug 15, 2024
1 parent 91ae3ae commit b626e94
Show file tree
Hide file tree
Showing 4 changed files with 938 additions and 333 deletions.
5 changes: 4 additions & 1 deletion mixins/db.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ module.exports = function (collection, dbUrl = process.env.MONGO_URI) {
const MongoAdapter = require('moleculer-db-adapter-mongo');
return {
mixins: [DbService],
adapter: new MongoAdapter(dbUrl),
adapter: new MongoAdapter(dbUrl, {
useUnifiedTopology: true,
}),
collection,
};
}

// Create data folder
mkdir(path.resolve('./data'));
return {
Expand Down
6 changes: 3 additions & 3 deletions moleculer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ module.exports = {
logger: true,
logLevel: 'info',
cacher: {
type: 'Memory',
type: 'MemoryLRU',
options: {
ttl: 432000,
clone: true,
max: 50000,
ttl: 345600,
},
},
metrics: false,
Expand Down
Loading

0 comments on commit b626e94

Please sign in to comment.