chore: enable ws proxy in admin-web dev server and log compliance recheck failures
- admin-web vite dev server now proxies websockets on /api so live features (e.g. SSE/WS) work in development. - Tenant desktop publish compliance recheck now logs warnings when the query, scan or row iteration fails so the silent 50118 errors can be diagnosed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -61,6 +61,7 @@ export default defineConfig(({ mode }) => {
|
||||
'/api': {
|
||||
target: env.VITE_API_PROXY_TARGET || 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
},
|
||||
'/swagger': {
|
||||
target: env.VITE_API_PROXY_TARGET || 'http://localhost:8080',
|
||||
|
||||
@@ -255,7 +255,7 @@ func (s *DesktopTaskService) recheckQueuedPublishTasksForClient(ctx context.Cont
|
||||
return nil
|
||||
}
|
||||
rows, err := s.pool.Query(ctx, `
|
||||
SELECT DISTINCT
|
||||
SELECT
|
||||
j.desktop_id,
|
||||
j.tenant_id,
|
||||
j.workspace_id,
|
||||
@@ -276,6 +276,7 @@ func (s *DesktopTaskService) recheckQueuedPublishTasksForClient(ctx context.Cont
|
||||
LIMIT 5
|
||||
`, client.ID)
|
||||
if err != nil {
|
||||
s.logWarn("desktop publish compliance recheck query failed", err, zap.String("client_id", client.ID.String()))
|
||||
return response.ErrInternal(50118, "desktop_publish_compliance_recheck_failed", "failed to load publish jobs for compliance recheck")
|
||||
}
|
||||
defer rows.Close()
|
||||
@@ -293,6 +294,7 @@ func (s *DesktopTaskService) recheckQueuedPublishTasksForClient(ctx context.Cont
|
||||
for rows.Next() {
|
||||
var item candidate
|
||||
if scanErr := rows.Scan(&item.JobID, &item.TenantID, &item.WorkspaceID, &item.CreatedByUserID, &item.ArticleID, &item.ArticleVersionID, &item.Platforms); scanErr != nil {
|
||||
s.logWarn("desktop publish compliance recheck scan failed", scanErr, zap.String("client_id", client.ID.String()))
|
||||
return response.ErrInternal(50118, "desktop_publish_compliance_recheck_failed", "failed to scan publish job for compliance recheck")
|
||||
}
|
||||
if item.WorkspaceID == client.WorkspaceID && item.TenantID == client.TenantID {
|
||||
@@ -300,6 +302,7 @@ func (s *DesktopTaskService) recheckQueuedPublishTasksForClient(ctx context.Cont
|
||||
}
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
s.logWarn("desktop publish compliance recheck rows failed", err, zap.String("client_id", client.ID.String()))
|
||||
return response.ErrInternal(50118, "desktop_publish_compliance_recheck_failed", "failed to iterate publish jobs for compliance recheck")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user