mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2025-03-26 00:17:06 +01:00
Check google drive file size
This commit is contained in:
parent
30fa15e367
commit
a0727b0ce6
1 changed files with 18 additions and 1 deletions
|
@ -44,7 +44,7 @@
|
|||
|
||||
timeout = setTimeout(() => {
|
||||
handleError();
|
||||
}, 15000);
|
||||
}, 30000);
|
||||
}
|
||||
|
||||
function cancelTimeout() {
|
||||
|
@ -291,6 +291,23 @@
|
|||
async function getData() {
|
||||
console.log('reading remote file now');
|
||||
|
||||
try {
|
||||
const { result } = await gapi.client.drive.files.get({
|
||||
fileId: $saveId,
|
||||
fields: 'size',
|
||||
});
|
||||
|
||||
console.log('drive size', result);
|
||||
if (result.size > 50000000) {
|
||||
return {
|
||||
[UPDATE_TIME_KEY]: dayjs('2000-01-01-00:00'),
|
||||
};
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('get file size error', err);
|
||||
handleError();
|
||||
}
|
||||
|
||||
try {
|
||||
const { result } = await gapi.client.drive.files.get({
|
||||
fileId: $saveId,
|
||||
|
|
Loading…
Add table
Reference in a new issue