Skip to content

Commit

Permalink
默认禁用缓存
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinkPHP authored and ThinkPHP committed Oct 5, 2021
1 parent 5d1ffd5 commit 16b4665
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var resultCache = new Bob.CacheResult('translate-result');
* @return {object} 一个符合 bob 识别的翻译结果对象
*/
async function _translate(text: string, options: QueryOption = {}): Promise<Bob.TranslateResult> {
const { from = 'auto', to = 'auto', cache = 'enable', tld = 'com', timeout = 10000 } = options;
const { from = 'auto', to = 'auto', cache = 'disable', tld = 'com', timeout = 10000 } = options;
const cacheKey = `${text}${from}${to}`;
if (cache === 'enable') {
const _cacheData = resultCache.get(cacheKey);
Expand Down

0 comments on commit 16b4665

Please sign in to comment.