mirror of
https://fast.feibisi.com/https://github.com/parcelvoy/platform.git
synced 2025-09-01 12:26:08 +08:00
Merge branch 'main' into feat/subscription-preferences-page
This commit is contained in:
commit
ae740ff79c
7 changed files with 18 additions and 12 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -24,7 +24,6 @@ jobs:
|
|||
npm run lint
|
||||
|
||||
test:
|
||||
needs: lint
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
|
@ -78,7 +77,6 @@ jobs:
|
|||
STORAGE_DRIVER: s3
|
||||
|
||||
build:
|
||||
needs: lint
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
|
|
|
@ -16,6 +16,7 @@ import CampaignSendJob from '../campaigns/CampaignSendJob'
|
|||
import CampaignStateJob from '../campaigns/CampaignStateJob'
|
||||
import CampaignGenerateListJob from '../campaigns/CampaignGenerateListJob'
|
||||
import CampaignInteractJob from '../campaigns/CampaignInteractJob'
|
||||
import PushJob from '../providers/push/PushJob'
|
||||
|
||||
export type Queues = Record<number, Queue>
|
||||
|
||||
|
@ -32,6 +33,7 @@ export const loadJobs = (queue: Queue) => {
|
|||
queue.register(ListPopulateJob)
|
||||
queue.register(ListStatsJob)
|
||||
queue.register(ProcessListsJob)
|
||||
queue.register(PushJob)
|
||||
queue.register(TextJob)
|
||||
queue.register(UserPatchJob)
|
||||
queue.register(UserDeleteJob)
|
||||
|
|
|
@ -26,7 +26,9 @@ export default class BugSnagProvider implements ErrorHandlingProvider {
|
|||
}
|
||||
}
|
||||
|
||||
notify(error: Error) {
|
||||
Bugsnag.notify(error)
|
||||
notify(error: Error, context?: Record<string, any>) {
|
||||
Bugsnag.notify(error, (event) => {
|
||||
context && event.addMetadata('context', context)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ export default class ErrorHandler {
|
|||
this.provider?.attach(api)
|
||||
}
|
||||
|
||||
notify(error: Error) {
|
||||
this.provider?.notify(error)
|
||||
notify(error: Error, context?: Record<string, any>) {
|
||||
this.provider?.notify(error, context)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,5 +4,5 @@ export type ErrorHandlerProviderName = 'bugsnag' | 'sentry'
|
|||
|
||||
export default interface ErrorHandlerProvider {
|
||||
attach(api: Koa): void
|
||||
notify(error: Error): void
|
||||
notify(error: Error, context?: Record<string, any>): void
|
||||
}
|
||||
|
|
|
@ -31,9 +31,13 @@ export default class Queue {
|
|||
}
|
||||
|
||||
async dequeue(job: EncodedJob): Promise<boolean> {
|
||||
await this.started(job)
|
||||
await this.jobs[job.name](job.data)
|
||||
await this.completed(job)
|
||||
try {
|
||||
await this.started(job)
|
||||
await this.jobs[job.name](job.data)
|
||||
await this.completed(job)
|
||||
} catch (error: any) {
|
||||
this.errored(job, error)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -62,7 +66,7 @@ export default class Queue {
|
|||
|
||||
async errored(job: EncodedJob | undefined, error: Error) {
|
||||
logger.error({ error, job }, 'queue:job:errored')
|
||||
App.main.error.notify(error)
|
||||
App.main.error.notify(error, job)
|
||||
}
|
||||
|
||||
async completed(job: EncodedJob) {
|
||||
|
|
|
@ -7,7 +7,7 @@ server {
|
|||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location ~ ^\/(api|uploads|.well-known|c|o) {
|
||||
location ~ ^\/(api|uploads|.well-known|c\/|o\/) {
|
||||
proxy_pass http://api:3001;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue