Commit Graph

14 Commits

Author SHA1 Message Date
Misaka_Company
dd27cbaf97 fix: remove redundant ntfy messages and harden Uptime Kuma heartbeat
run_incremental_sync.py:
- Replace ntfy-pushing log_start/log_success with log_info. Liveness is
  owned by Uptime Kuma's heartbeat, so the startup and per-table success
  messages no longer duplicate Uptime's notifications.

uptime_kuma_utils.py (shared util, backward compatible):
- Run the heartbeat in a background daemon thread (new start()/stop()),
  decoupled from the sync loop so heartbeat network time/retries never
  delay syncing.
- Add retry (up to 3 attempts) and raise request timeout 5s -> 10s to
  tolerate Uptime Kuma's intermittent slow responses / transient 4xx.
- Keep send_heartbeat/check_and_send_heartbeat/send_stop_signal as
  backward-compatible wrappers; excel_sync_to_sql.py still uses them and
  now benefits from the longer timeout + retry.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-15 13:06:53 +08:00
Misaka_Company
17b6b246c7 Merge feat/auto-create-table-and-verify-sync into main
Merge auto table creation with per-PK sync verification, combining
both features: target tables are auto-created when missing, and
every sync batch is verified by primary key before marking synced.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-12 10:52:54 +08:00
Misaka_Company
1ae901a040 feat: add auto table creation and per-PK sync verification
- Add new Access table mappings for transmitter contracts (25/26年变送器) and tube bending workshop (弯管车间烘洗)
- Add auto-create target table from Access schema when table does not exist (db_utils + init_full_sync)
- Implement per-primary-key verification in incremental sync: verify deletes are gone and inserts are present before marking Synced=1
- Add post-commit re-verification with Synced rollback on failure for automatic retry
- Batch IN clause parameters to stay under SQL Server limit
- Adjust poll interval from 5s to 30s
- Improve IDENTITY_INSERT cleanup in finally blocks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-12 10:50:01 +08:00
Misaka_Company
3791966446 Improve transaction management and connection cleanup in incremental sync
- Add explicit BEGIN TRANSACTION for clear transaction boundaries
- Ensure IDENTITY_INSERT state is properly tracked and cleaned up
- Add finally block to guarantee Access connection cleanup
- Move table existence check inside sync loop for better scope

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-11 15:33:57 +08:00
Misaka_Company
11d284a6bf Add identity column check and manage IDENTITY_INSERT state during sync 2026-01-15 10:27:32 +08:00
Misaka_Company
086c59cc03 Refactor Uptime Kuma heartbeat implementation to use UptimeKumaMonitor class, enhancing maintainability and logging capabilities 2026-01-15 08:52:20 +08:00
Misaka_Company
3bcc5aafbe Add Uptime Kuma heartbeat configuration and implement heartbeat functionality 2026-01-12 17:43:33 +08:00
Misaka_Company
9192f15610 Change log message from log_success to log_info for table sync completion 2026-01-12 16:43:37 +08:00
Misaka_Company
4721634b81 Refactor logging system to use unified log_utils module and enhance logging messages across multiple scripts 2026-01-12 13:55:28 +08:00
Misaka_Company
83c90f0161 Refactor configuration management and remove deprecated files
- Consolidated database, file source, and field mapping configurations into dedicated modules under the `config` directory.
- Removed hardcoded database connection details from `migration.py` and replaced them with imports from the new configuration structure.
- Updated `ntfy_utils.py` and `run_incremental_sync.py` to utilize the new configuration imports for cleaner code and better maintainability.
- Deleted `update_config.py` as its contents have been integrated into the new configuration files.
- Added a new `settings.local.json` for managing permissions related to script execution.
- Enhanced the structure of the migration tasks and Excel configurations for better organization and clarity.
2026-01-12 12:49:51 +08:00
Misaka_Company
c50573fd78 Add ntfy notification system and enhance logging for error handling 2026-01-08 13:30:38 +08:00
Misaka_Company
5defe7b80d Refactor logging functions to enhance clarity and consistency in log messages 2026-01-07 15:17:20 +08:00
Misaka_Company
a1c8a572bd Enhance logging and synchronization features across multiple scripts
- Added detailed logging functionality to init_full_sync.py and run_incremental_sync.py for better tracking of synchronization processes.
- Updated configuration mappings in config.py to include additional Access database tables.
- Improved error handling and user feedback in vbareplace.py, including the ability to refresh linked tables in Access.
- Adjusted polling intervals and batch sizes for performance optimization.
2026-01-07 15:01:27 +08:00
Misaka_Company
77b72392a3 first commit 2026-01-06 15:40:38 +08:00