Skip to content

Commit

Permalink
fix: stop send logs to logtail, it might be the reason stops the mult…
Browse files Browse the repository at this point in the history
…iple update function
  • Loading branch information
hudy9x committed Mar 11, 2024
1 parent 4510e0c commit d512f55
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
3 changes: 3 additions & 0 deletions packages/be-gateway/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ import './lib/redis'
import './lib/firebase-admin'
import './events'
import Routes from './routes'
import { Log } from './lib/log'

connectPubClient()
const app: Application = express()

app.get('/check-health', (req, res) => {
Log.info('Heelo')
Log.flush()
res.send(`🚀🎃🎃🎨🎨:e Site available ${new Date()} `)
})

Expand Down
10 changes: 5 additions & 5 deletions packages/be-gateway/src/routes/organization/index.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,21 @@ export class OrganizationController extends BaseController {
// return cached
// }

Log.info('Getting org list of ', { id })
// Log.info('Getting org list of ', { id })
const orgIds = await mdOrgMemGetByUid(id)
const orgs = await mdOrgGet(orgIds.map(org => org.organizationId))
Log.debug(`Returned org list: ${orgs.length}`, { id, orgs, orgIds })
// Log.debug(`Returned org list: ${orgs.length}`, { id, orgs, orgIds })

setJSONCache(key, orgs)
Log.flush()
// Log.flush()

// res.setHeader('Cache-Control', 'max-age=20, public')

return orgs
} catch (error) {
console.log(error)
Log.debug('Getting org list error', { error })
Log.flush()
// Log.debug('Getting org list error', { error })
// Log.flush()
throw new InternalServerException()
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/be-gateway/src/routes/task/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ router.put('/project/task-many', async (req: AuthRequest, res) => {
const { id: userId } = req.authen
const key = [CKEY.TASK_QUERY, data.projectId]

Log.info(`Update multiple task by uid: ${userId}`, { data })
// Log.info(`Update multiple task by uid: ${userId}`, { data })
try {
data.updatedAt = new Date()
data.updatedBy = userId
Expand All @@ -454,7 +454,7 @@ router.put('/project/task-many', async (req: AuthRequest, res) => {
})
} catch (error) {
console.log('update multiple task error', error)
Log.debug('Update multiple task error failed', { error })
// Log.debug('Update multiple task error failed', { error })
res.status(500).send(error)
}
})
Expand Down
16 changes: 8 additions & 8 deletions packages/shared-models/src/lib/projectPin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ const _updatePinSetting = async ({

// set a default setting for pinned projects
console.log('settings', settings)
Log.info(`Get user's settings: ${user.id}`, { settings })
// Log.info(`Get user's settings: ${user.id}`, { settings })
if (type === 'pin' && !settings.pinnedProjects) {
settings.pinnedProjects = []
Log.debug('Fill default pinnedProjects', { settings })
// Log.debug('Fill default pinnedProjects', { settings })
}

if (!settings || !settings.pinnedProjects) {
Log.debug('Setting still empty', { settings })
Log.flush()
// Log.debug('Setting still empty', { settings })
// Log.flush()
return
}

Expand All @@ -74,8 +74,8 @@ const _updatePinSetting = async ({
}
})

Log.info('Pin a project in user settings', { result })
Log.flush()
// Log.info('Pin a project in user settings', { result })
// Log.flush()

// unpin project
} else {
Expand All @@ -92,8 +92,8 @@ const _updatePinSetting = async ({
}
}
})
Log.info('Unpin project from user setting', { result })
Log.flush()
// Log.info('Unpin project from user setting', { result })
// Log.flush()
}
})
}
Expand Down

0 comments on commit d512f55

Please sign in to comment.