fix idiot problem

This commit is contained in:
liaojack8 2020-07-05 22:55:15 +08:00
parent a7602d9cf5
commit 3b94ccac7d
2 changed files with 4 additions and 3 deletions

View File

@ -289,7 +289,7 @@ async function get_access_token () {
// get_sa_token().catch(console.error)
async function get_sa_token () {
if (use_sa && !SA_TOKENS.length) SA_TOKENS = get_sa_batch()
if (!SA_TOKENS.length) SA_TOKENS = get_sa_batch()
while (SA_TOKENS.length) {
const tk = get_random_element(SA_TOKENS)
try {
@ -567,8 +567,9 @@ async function copy_file (id, parent, use_sa, limit) {
}
}
}
if (!SA_TOKENS.length) {
if (use_sa && !SA_TOKENS.length) {
if (limit) limit.clearQueue()
if (task_id) db.prepare('update task set status=? where id=?').run('error', task_id)
throw new Error('所有SA帐号流量已用完')
} else {
console.warn('复制文件失败文件id: ' + id)

View File

@ -157,7 +157,7 @@ async function tg_copy ({ fid, target, chat_id, update }) { // return task_id
}
}
real_copy({ source: fid, update, target, service_account: !USE_PERSONAL_AUTH, is_server: true })
real_copy({ source: fid, update, target, not_teamdrive: true, service_account: true, is_server: true })
.then(async info => {
if (!record) record = {} // 防止无限循环
if (!info) return