Skip to content

Commit

Permalink
fix: Issue with db calls in team logs command (#179)
Browse files Browse the repository at this point in the history
Co-authored-by: Samuel Gravis <samuel.gravis@dashlane.com>
  • Loading branch information
Sgravis and Samuel Gravis committed Aug 30, 2023
1 parent 28fd4ec commit 4bda796
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/command-handlers/teamLogs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import winston from 'winston';
import { connectAndPrepare } from '../modules/database';
import { StartAuditLogsQueryParams, startAuditLogsQuery, getAuditLogQueryResults } from '../endpoints';
import { getTeamDeviceCredentials, jsonToCsv, epochTimestampToIso } from '../utils';
import { GenericLog } from '../types/logs';
Expand All @@ -17,15 +16,13 @@ export const runTeamLogs = async (options: {
const { start, type, category } = options;
const end = options.end === 'now' ? Date.now().toString() : options.end;

const { db } = await connectAndPrepare({ autoSync: false });
let logs = await getAuditLogs({
teamDeviceCredentials,
startDateRangeUnix: parseInt(start),
endDateRangeUnix: parseInt(end),
logType: type,
category,
});
db.close();

if (options.humanReadable) {
logs = logs.map((log) => {
Expand Down

0 comments on commit 4bda796

Please sign in to comment.