mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 04:43:12 +03:00
104f84f252
As discussed with the product team we want to enforce kebab-case file names for all files, with the exception of files which export a single class, in which case they should be PascalCase and reflect the class which they export. This will help find classes faster, and should push better naming for them too. Some files and packages have been excluded from this linting, specifically when a library or framework depends on the naming of a file for the functionality e.g. Ember, knex-migrator, adapter-manager
21 lines
594 B
JavaScript
21 lines
594 B
JavaScript
/**
|
|
* This is a cache provider that lives very short in memory, there is no need for persistence.
|
|
* It is created when scheduling an email in the batch sending service, and is then passed to the sending service. The sending service
|
|
* can optionally use a passed cache provider to reuse the email body for each batch with the same segment.
|
|
*/
|
|
class EmailBodyCache {
|
|
constructor() {
|
|
this.cache = new Map();
|
|
}
|
|
|
|
get(key) {
|
|
return this.cache.get(key) ?? null;
|
|
}
|
|
|
|
set(key, value) {
|
|
this.cache.set(key, value);
|
|
}
|
|
}
|
|
|
|
module.exports = EmailBodyCache;
|