-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathextensions.py
More file actions
22 lines (18 loc) · 801 Bytes
/
extensions.py
File metadata and controls
22 lines (18 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright (C) 2025 Fotios Tsiadimos
# SPDX-License-Identifier: GPL-3.0-only
#
# ============================================================================
# BashTower - Flask Extensions
# ============================================================================
# Shared Flask extensions (db, scheduler) are initialized here.
# ===========================================================================
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from apscheduler.schedulers.background import BackgroundScheduler
# Database instance
db = SQLAlchemy()
# Migration instance
migrate = Migrate()
# Scheduler instance
# Configure with max_instances=1 to avoid duplicate overlapping job executions
scheduler = BackgroundScheduler(job_defaults={'max_instances': 1})