chore(v2): dead-code purge (fix bundle 3)
~1300 lines removed across four cleanups. Pure deletions; no behavioural changes. 1. **transaction_processor.py — DELETED (1274 lines).** Orphaned v1 file that hasn't been imported anywhere since fix-bundle-1 wired the v2 distribution chain. The historical Lamassu logic is preserved in git history at any commit on main. 2. **views_api.v2_in_progress_stub — DELETED.** The catch-all that returned 503 for any unmatched /api/v1/dca/* path. With P3a–P9g shipped, every documented endpoint is implemented; the catch-all was stale and (per issue #11 M7) unauthenticated, so it leaked the extension's existence to anonymous probes. Removed entirely. 3. **tasks.hourly_transaction_polling — DELETED.** v1 LegacyLamassu polling no-op. The associated `create_permanent_unique_task` spawn in __init__.py is also gone (was spawning a forever-sleeping task for no reason). 4. **__init__.py scaffolding artifacts.** - Replaced the placeholder "you can debug in your extension using 'import logger from loguru'" template log with a meaningful "satmachineadmin v2 loaded" INFO line. - Dropped the now-stale `hourly_transaction_polling` import + spawn. - Sorted __all__ (RUF022). Migration collapse (m001..m007 → single m001_v2_initial) was on the fix-bundle-3 list but is deferred to a separate PR. The current migrations are harmless on fresh installs (idempotent CREATE/DROP chain) and collapsing them risks breaking the LNbits version tracker on the off chance any operator has v1 data; better to do that as a dedicated migration-discipline change once we're confident no v1 operator data exists in the wild. Routes: 34 → 33 (catch-all gone). 76/76 tests pass. Refs: aiolabs/satmachineadmin#11 — fix bundle 3 ✅ (modulo migration collapse). Remaining in #11: M1-M12 + N1-N12. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
00b8253dd3
commit
b96837164e
4 changed files with 10 additions and 1311 deletions
25
__init__.py
25
__init__.py
|
|
@ -5,17 +5,16 @@ from lnbits.tasks import create_permanent_unique_task
|
|||
from loguru import logger
|
||||
|
||||
from .crud import db
|
||||
from .tasks import wait_for_paid_invoices, hourly_transaction_polling
|
||||
from .tasks import wait_for_paid_invoices
|
||||
from .views import satmachineadmin_generic_router
|
||||
from .views_api import satmachineadmin_api_router
|
||||
|
||||
logger.debug(
|
||||
"This logged message is from satmachineadmin/__init__.py, you can debug in your "
|
||||
"extension using 'import logger from loguru' and 'logger.debug(<thing-to-log>)'."
|
||||
logger.info("satmachineadmin v2 loaded")
|
||||
|
||||
|
||||
satmachineadmin_ext: APIRouter = APIRouter(
|
||||
prefix="/satmachineadmin", tags=["DCA Admin"]
|
||||
)
|
||||
|
||||
|
||||
satmachineadmin_ext: APIRouter = APIRouter(prefix="/satmachineadmin", tags=["DCA Admin"])
|
||||
satmachineadmin_ext.include_router(satmachineadmin_generic_router)
|
||||
satmachineadmin_ext.include_router(satmachineadmin_api_router)
|
||||
|
||||
|
|
@ -38,19 +37,17 @@ def satmachineadmin_stop():
|
|||
|
||||
|
||||
def satmachineadmin_start():
|
||||
# Start invoice listener task
|
||||
invoice_task = create_permanent_unique_task("ext_satmachineadmin", wait_for_paid_invoices)
|
||||
# bitSpire invoice listener — replaces the v1 SSH/PostgreSQL poller.
|
||||
invoice_task = create_permanent_unique_task(
|
||||
"ext_satmachineadmin", wait_for_paid_invoices
|
||||
)
|
||||
scheduled_tasks.append(invoice_task)
|
||||
|
||||
# Start hourly transaction polling task
|
||||
polling_task = create_permanent_unique_task("ext_satmachineadmin_polling", hourly_transaction_polling)
|
||||
scheduled_tasks.append(polling_task)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"db",
|
||||
"satmachineadmin_ext",
|
||||
"satmachineadmin_static_files",
|
||||
"satmachineadmin_start",
|
||||
"satmachineadmin_static_files",
|
||||
"satmachineadmin_stop",
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue