di-refactor coming along
This commit is contained in:
parent
7d9044ab29
commit
60ada5f6a3
20 changed files with 582 additions and 335 deletions
|
|
@ -1,14 +1,17 @@
|
|||
import { getLogger } from '@stock-bot/logger';
|
||||
import { getPostgreSQLClient } from '../../../clients';
|
||||
import type { ServiceContainer } from '@stock-bot/di';
|
||||
import type { JobPayload, SyncStatus } from '../../../types/job-payloads';
|
||||
|
||||
const logger = getLogger('enhanced-sync-status');
|
||||
|
||||
export async function getSyncStatus(payload: JobPayload): Promise<SyncStatus[]> {
|
||||
export async function getSyncStatus(
|
||||
payload: JobPayload,
|
||||
container: ServiceContainer
|
||||
): Promise<SyncStatus[]> {
|
||||
logger.info('Getting comprehensive sync status...');
|
||||
|
||||
try {
|
||||
const postgresClient = getPostgreSQLClient();
|
||||
const postgresClient = container.postgres;
|
||||
const query = `
|
||||
SELECT provider, data_type as "dataType", last_sync_at as "lastSyncAt",
|
||||
last_sync_count as "lastSyncCount", sync_errors as "syncErrors"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue