Skip to content

Commit

Permalink
deploy: 7e54d51
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed Jul 20, 2023
1 parent db6dba3 commit 8f7fef8
Show file tree
Hide file tree
Showing 36 changed files with 995 additions and 656 deletions.
6 changes: 6 additions & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@

<h1>Changelog</h1>
<p>All notable changes to this project will be documented in this file.</p>
<h3>4.1.0 (2023-07-20)</h3>
<p><strong>Feature</strong></p>
<ul>
<li>Add config <code>REDIS.namespace</code></li>
<li>Improve Redis Store</li>
</ul>
<h3>4.0.1 (2023-07-17)</h3>
<p><strong>Feature</strong></p>
<ul>
Expand Down
18 changes: 9 additions & 9 deletions dependencies.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,27 @@
</ol>
<ul class="dependencies-list">
<li>
<b>@aws-sdk/client-s3</b> : ^3.369.0</li>
<b>@aws-sdk/client-s3</b> : ^3.373.0</li>
<li>
<b>@nestjs/axios</b> : ^3.0.0</li>
<li>
<b>@nestjs/common</b> : ^10.0.5</li>
<b>@nestjs/common</b> : ^10.1.0</li>
<li>
<b>@nestjs/core</b> : ^10.0.5</li>
<b>@nestjs/core</b> : ^10.1.0</li>
<li>
<b>@nestjs/jwt</b> : ^10.1.0</li>
<li>
<b>@nestjs/mapped-types</b> : ^2.0.2</li>
<li>
<b>@nestjs/passport</b> : ^10.0.0</li>
<li>
<b>@nestjs/platform-express</b> : ^10.0.5</li>
<b>@nestjs/platform-express</b> : ^10.1.0</li>
<li>
<b>@nestjs/throttler</b> : ^4.2.1</li>
<li>
<b>@typegoose/auto-increment</b> : ^3.3.0</li>
<b>@typegoose/auto-increment</b> : ^3.4.0</li>
<li>
<b>@typegoose/typegoose</b> : ^11.3.0</li>
<b>@typegoose/typegoose</b> : ^11.4.0</li>
<li>
<b>akismet-api</b> : ^6.0.0</li>
<li>
Expand All @@ -94,7 +94,7 @@
<li>
<b>express</b> : ^4.18.2</li>
<li>
<b>fast-xml-parser</b> : ^4.2.5</li>
<b>fast-xml-parser</b> : ^4.2.6</li>
<li>
<b>googleapis</b> : ^122.0.0</li>
<li>
Expand All @@ -106,11 +106,11 @@
<li>
<b>lodash</b> : ^4.17.21</li>
<li>
<b>mongoose</b> : ~7.3.4</li>
<b>mongoose</b> : ~7.4.0</li>
<li>
<b>node-schedule</b> : ^2.1.1</li>
<li>
<b>nodemailer</b> : ^6.9.3</li>
<b>nodemailer</b> : ^6.9.4</li>
<li>
<b>passport</b> : ~0.6.0</li>
<li>
Expand Down
6 changes: 3 additions & 3 deletions injectables/ArchiveService.html
Original file line number Diff line number Diff line change
Expand Up @@ -504,15 +504,15 @@ <h3 id="inputs">
import { InjectModel } from &#x27;@app/transformers/model.transformer&#x27;
import { CacheService, CacheManualResult } from &#x27;@app/processors/cache/cache.service&#x27;
import { MongooseModel } from &#x27;@app/interfaces/mongoose.interface&#x27;
import { CacheKeys } from &#x27;@app/constants/cache.constant&#x27;
import { SortType } from &#x27;@app/constants/biz.constant&#x27;
import { Category } from &#x27;@app/modules/category/category.model&#x27;
import { Tag } from &#x27;@app/modules/tag/tag.model&#x27;
import {
Article,
ARTICLE_LIST_QUERY_GUEST_FILTER,
ARTICLE_LIST_QUERY_PROJECTION
} from &#x27;@app/modules/article/article.model&#x27;
import { Tag } from &#x27;@app/modules/tag/tag.model&#x27;
import * as CACHE_KEY from &#x27;@app/constants/cache.constant&#x27;
import logger from &#x27;@app/utils/logger&#x27;

const log &#x3D; logger.scope(&#x27;ArchiveService&#x27;)
Expand All @@ -534,7 +534,7 @@ <h3 id="inputs">
@InjectModel(Category) private readonly categoryModel: MongooseModel&lt;Category&gt;
) {
this.archiveCache &#x3D; this.cacheService.manual({
key: CACHE_KEY.ARCHIVE,
key: CacheKeys.Archive,
promise: this.getArchiveData.bind(this)
})
this.updateCache().catch((error) &#x3D;&gt; {
Expand Down
4 changes: 2 additions & 2 deletions injectables/ArticleService.html
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,7 @@ <h3 id="inputs">
import { ArchiveService } from &#x27;@app/modules/archive/archive.service&#x27;
import { TagService } from &#x27;@app/modules/tag/tag.service&#x27;
import { PublishState } from &#x27;@app/constants/biz.constant&#x27;
import { CacheKeys } from &#x27;@app/constants/cache.constant&#x27;
import { NULL } from &#x27;@app/constants/value.constant&#x27;
import { MongooseModel, MongooseDoc, MongooseID } from &#x27;@app/interfaces/mongoose.interface&#x27;
import { PaginateResult, PaginateQuery, PaginateOptions } from &#x27;@app/utils/paginate&#x27;
Expand All @@ -1836,7 +1837,6 @@ <h3 id="inputs">
ARTICLE_FULL_QUERY_REF_POPULATE,
ARTICLE_HOTTEST_SORT_PARAMS
} from &#x27;./article.model&#x27;
import * as CACHE_KEY from &#x27;@app/constants/cache.constant&#x27;

@Injectable()
export class ArticleService {
Expand All @@ -1850,7 +1850,7 @@ <h3 id="inputs">
@InjectModel(Article) private readonly articleModel: MongooseModel&lt;Article&gt;
) {
this.hottestArticlesCache &#x3D; this.cacheService.interval({
key: CACHE_KEY.HOTTEST_ARTICLES,
key: CacheKeys.HottestArticles,
promise: () &#x3D;&gt; this.getHottestArticles(20),
interval: 1000 * 60 * 30, // 30 mins,
retry: 1000 * 60 * 5 // 5 mins
Expand Down
6 changes: 3 additions & 3 deletions injectables/CacheInterceptor.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ <h3 id="methods">
import { getCacheKey, getCacheTTL } from &#x27;@app/decorators/cache.decorator&#x27;
import { CacheService } from &#x27;@app/processors/cache/cache.service&#x27;
import { UNDEFINED, isNil } from &#x27;@app/constants/value.constant&#x27;
import { CACHE_PREFIX } from &#x27;@app/constants/cache.constant&#x27;
import { getDecoratorCacheKey } from &#x27;@app/constants/cache.constant&#x27;
import logger from &#x27;@app/utils/logger&#x27;

const log &#x3D; logger.scope(&#x27;CacheInterceptor&#x27;)
Expand Down Expand Up @@ -376,7 +376,7 @@ <h3 id="methods">
const ttl &#x3D; getCacheTTL(target)

try {
const value &#x3D; await this.cacheService.get(CACHE_PREFIX + key)
const value &#x3D; await this.cacheService.get(getDecoratorCacheKey(key))
if (!isNil(value)) {
return of(value)
}
Expand All @@ -388,7 +388,7 @@ <h3 id="methods">
}

try {
await this.cacheService.set(CACHE_PREFIX + key, response, ttl)
await this.cacheService.set(getDecoratorCacheKey(key), response, ttl)
} catch (err) {
log.warn(&#x60;An error has occurred when inserting &quot;key: ${key}&quot;, &quot;value: ${response}&quot;&#x60;)
}
Expand Down
6 changes: 3 additions & 3 deletions injectables/CacheService.html
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ <h3 id="methods">
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code>Promise&lt;void&gt;</code>
<b>Returns : </b> <code>Promise&lt;boolean&gt;</code>

</div>
<div class="io-description">
Expand Down Expand Up @@ -921,8 +921,8 @@ <h3 id="methods">
return this.redisService.store.get&lt;T&gt;(key) as Promise&lt;T&gt;
}

public delete(key: string): Promise&lt;void&gt; {
return this.redisService.store.del(key)
public delete(key: string): Promise&lt;boolean&gt; {
return this.redisService.store.delete(key)
}

/** Execute the Promise and store the data into the cache. */
Expand Down
Loading

0 comments on commit 8f7fef8

Please sign in to comment.