fix: add temporary logs

This commit is contained in:
Hossein Mehrabi 2023-09-18 13:39:33 +03:30
parent 80adc4c694
commit 9b2c10813a
No known key found for this signature in database
GPG Key ID: 45C04964191AFAA1
1 changed files with 11 additions and 2 deletions

View File

@ -223,11 +223,18 @@ export class UnbodyService {
const oldData = { ...this.data } const oldData = { ...this.data }
this.data = newData this.data = newData
if (this.firstLoad) this.firstLoad = false
callback(this.data) callback(this.data)
console.log({
firstLoad: this.firstLoad,
isVercel,
isBuildTime,
sendDiscordNotifications,
})
if (!this.firstLoad && !isVercel) { if (!this.firstLoad && !isVercel) {
const changes = isBuildTime ? [] : this.findChanges(oldData, newData) const changes = isBuildTime ? [] : this.findChanges(oldData, newData)
console.log('changes', changes.length)
if (sendDiscordNotifications) { if (sendDiscordNotifications) {
const [_res, err] = await settle(() => const [_res, err] = await settle(() =>
@ -245,6 +252,8 @@ export class UnbodyService {
} }
} }
} }
if (this.firstLoad) this.firstLoad = false
} catch (error) { } catch (error) {
console.error(error) console.error(error)
} finally { } finally {
@ -636,7 +645,7 @@ export class UnbodyService {
data: T | null = null, data: T | null = null,
errors: any = null, errors: any = null,
): ApiResponse<T> => { ): ApiResponse<T> => {
if (errors) console.log(errors) if (errors) console.error(errors)
if (errors || !data) { if (errors || !data) {
return { return {
data: data as any, data: data as any,