修复云端数据一致性问题
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
// those prefixes are reserved by Tencent Cloud SCF. Use the TTS_ prefix.
|
||||
|
||||
const cloud = require('wx-server-sdk')
|
||||
const { cachedFileId } = require('./cache')
|
||||
cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV })
|
||||
|
||||
// Polished, fixed prompts.
|
||||
@@ -90,7 +91,8 @@ exports.main = async (event) => {
|
||||
if (!resolvedFileID) {
|
||||
try {
|
||||
const r = await db.collection('tts_cache').doc(cacheKey).get()
|
||||
if (r.data && r.data.length && r.data[0].fileID) resolvedFileID = r.data[0].fileID
|
||||
const cached = cachedFileId(r.data)
|
||||
if (cached) resolvedFileID = cached
|
||||
} catch (e) {} // 集合/文档不存在,走合成
|
||||
}
|
||||
if (resolvedFileID) {
|
||||
|
||||
Reference in New Issue
Block a user