fix idiot problem
This commit is contained in:
parent
a7602d9cf5
commit
3b94ccac7d
|
@ -289,7 +289,7 @@ async function get_access_token () {
|
||||||
|
|
||||||
// get_sa_token().catch(console.error)
|
// get_sa_token().catch(console.error)
|
||||||
async function get_sa_token () {
|
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) {
|
while (SA_TOKENS.length) {
|
||||||
const tk = get_random_element(SA_TOKENS)
|
const tk = get_random_element(SA_TOKENS)
|
||||||
try {
|
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 (limit) limit.clearQueue()
|
||||||
|
if (task_id) db.prepare('update task set status=? where id=?').run('error', task_id)
|
||||||
throw new Error('所有SA帐号流量已用完')
|
throw new Error('所有SA帐号流量已用完')
|
||||||
} else {
|
} else {
|
||||||
console.warn('复制文件失败,文件id: ' + id)
|
console.warn('复制文件失败,文件id: ' + id)
|
||||||
|
|
|
@ -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 => {
|
.then(async info => {
|
||||||
if (!record) record = {} // 防止无限循环
|
if (!record) record = {} // 防止无限循环
|
||||||
if (!info) return
|
if (!info) return
|
||||||
|
|
Loading…
Reference in New Issue