Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Matvey-Kuk committed Nov 20, 2024
1 parent 4e20033 commit 900cdf2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 19 deletions.
17 changes: 8 additions & 9 deletions keep/api/background_server_jobs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import os
import sys
import time
import requests

# It's a dirty hack to exclude current directory from sys.path
from keep.api.core.demo_mode import launch_demo_mode_thread
from keep.api.core.report_uptime import launch_uptime_reporting_thread

# It's a hack to exclude current directory from sys.path
# to avoid importing "logging.py" located in the same directory
# instead of the standard library "logging" module.
# TODO: rename logging.py
Expand All @@ -9,14 +15,7 @@
sys.path.pop(i)
break

import os
import time
import logging
import requests

from keep.api.core.demo_mode import launch_demo_mode_thread
from keep.api.core.report_uptime import launch_uptime_reporting_thread

import logging # noqa: E402
logger = logging.getLogger(__name__)


Expand Down
1 change: 0 additions & 1 deletion keep/api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import keep.api.logging
from keep.api.api import AUTH_TYPE
from keep.api.core.db_on_start import migrate_db, try_create_single_tenant
from keep.api.core.report_uptime import launch_uptime_reporting_thread
from keep.api.core.dependencies import SINGLE_TENANT_UUID
from keep.identitymanager.identitymanagerfactory import IdentityManagerTypes

Expand Down
2 changes: 1 addition & 1 deletion keep/api/core/demo_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def simulate_alerts(
try:
env = random.choice(["production", "staging", "development"])

if not "provider_id" in send_alert_url_params:
if "provider_id" not in send_alert_url_params:
send_alert_url_params["provider_id"] = f"{provider_type}-{env}"

prepared_request = PreparedRequest()
Expand Down
1 change: 0 additions & 1 deletion keep/api/core/posthog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import uuid
import posthog
import requests
from posthog import Posthog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"""

import sqlalchemy as sa
import sqlalchemy_utils
import sqlmodel
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "192157fd5788"
Expand Down
8 changes: 3 additions & 5 deletions scripts/shoot_alerts_from_dump.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import logging
import os
import sys
import json
import copy
import csv

import logging
import argparse

from keep.api.core.db import get_session_sync
from keep.api.models.alert import AlertDto
from keep.api.tasks.process_event_task import __handle_formatted_events
import sys
import argparse


# configure logging
logging.basicConfig(
Expand Down

0 comments on commit 900cdf2

Please sign in to comment.