|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import process from 'process'; |
|
|
|
|
import { Injectable } from '@nestjs/common'; |
|
|
|
|
import { Injectable, Logger } from '@nestjs/common'; |
|
|
|
|
import axios from 'axios'; |
|
|
|
|
import { compareVersions, validate } from 'compare-versions'; |
|
|
|
|
import { ViewTypes } from 'nocodb-sdk'; |
|
|
|
@ -75,6 +75,8 @@ interface AllMeta {
|
|
|
|
|
|
|
|
|
|
@Injectable() |
|
|
|
|
export class UtilsService { |
|
|
|
|
protected logger = new Logger(UtilsService.name); |
|
|
|
|
|
|
|
|
|
constructor(protected readonly configService: ConfigService<AppConfig>) {} |
|
|
|
|
|
|
|
|
|
lastSyncTime = dayjs(); |
|
|
|
@ -497,7 +499,7 @@ export class UtilsService {
|
|
|
|
|
try { |
|
|
|
|
return JSON.parse(cachedData); |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e); |
|
|
|
|
this.logger.error(e?.message, e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -520,7 +522,7 @@ export class UtilsService {
|
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e); |
|
|
|
|
this.logger.error(e?.message, e); |
|
|
|
|
return []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -551,7 +553,6 @@ export class UtilsService {
|
|
|
|
|
page: 1, |
|
|
|
|
missedItems: 0, |
|
|
|
|
}; |
|
|
|
|
while (!utils.found) { |
|
|
|
|
const feed = await this.feed({ |
|
|
|
|
query: { |
|
|
|
|
type: 'all', |
|
|
|
@ -561,7 +562,7 @@ export class UtilsService {
|
|
|
|
|
} as unknown as NcRequest); |
|
|
|
|
|
|
|
|
|
if (!feed || !feed?.length) { |
|
|
|
|
break; |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (const item of feed) { |
|
|
|
@ -569,15 +570,13 @@ export class UtilsService {
|
|
|
|
|
utils.found = true; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
utils.missedItems++; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!utils.found) { |
|
|
|
|
utils.page++; |
|
|
|
|
} |
|
|
|
|
if (utils.found) { |
|
|
|
|
return utils.missedItems; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return utils.missedItems; |
|
|
|
|
return `${utils.missedItems}+`; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|