Commit graph

20 commits

Author SHA1 Message Date
96f6a926be Fix NameError and add feature flag for scheduler
- Restored start_scheduler() function that was missing
- Added DISABLE_SCHEDULER feature flag check in main()
- App should start now without scheduler running
- Fixed 500 Internal Server Error

russell@unturf.com is the boss
2025-08-08 22:35:35 -04:00
266493ae8e Implement lightning-fast scheduler with micro-transactions
- Keep threading but use ultra-fast micro-transactions
- Step 1: Quick read-only query to find due action IDs
- Step 2: Process each action in separate micro-transaction
- Each transaction: Get→Update→Commit in <10ms
- Dispose engines immediately after each transaction
- No long-running transactions that could block web requests

russell@unturf.com is the boss
2025-08-08 22:23:14 -04:00
d0335db0a2 UI improvements: collapsible schedule menu and fix double extensions 2025-08-09 01:55:10 +00:00
26f6e86293 Implement namespace-isolated scheduler to eliminate main DB locks
MAJOR ARCHITECTURE CHANGE:
- Removed daemon thread that blocks main.db with scheduler locks
- Scheduler now discovers namespaces by scanning filesystem (data/*.db files)
- Each namespace processed in separate thread with only its own DB file
- Main DB never touched during scheduler operations
- Completely eliminates SQLite locking conflicts between web requests and scheduler

Key changes:
- dispatch_namespace_scheduler_jobs() replaces process_scheduled_actions()
- No more acquire_scheduler_lock() or release_scheduler_lock()
- No more SchedulerLock table in main DB
- ThreadPoolExecutor processes namespaces concurrently
- Web requests to main.db will never conflict with scheduler operations

This should completely fix the timeout issues since scheduler never touches main.db

russell@unturf.com is the boss
2025-08-08 21:47:42 -04:00
6a3dd08728 Optimize scheduler for minimal SQLite database locks
- Redesigned scheduler to use separate short-lived sessions for lock operations
- Lock acquisition and release now use independent database connections
- Each scheduled action processed in its own transaction to minimize lock time
- Error handling isolates failed actions to prevent blocking others
- Re-enabled scheduler with optimized locking strategy

Key improvements:
- acquire_scheduler_lock() uses own connection, disposes immediately
- release_scheduler_lock() uses own connection, disposes immediately
- process_single_scheduled_action() uses transaction-per-action approach
- Prevents long-running transactions that were blocking web requests

russell@unturf.com is the boss
2025-08-08 21:40:13 -04:00
3cede5ba07 Add scheduler disable flag to troubleshoot timeout issue
- Add DISABLE_SCHEDULER environment variable to disable scheduler
- Set DISABLE_SCHEDULER=true in deployment to test if scheduler is causing hangs
- This is a temporary fix to isolate the problem

russell@unturf.com is the boss
2025-08-08 21:32:52 -04:00
4d899d367f Introduced support for scheduling actions 2025-06-09 01:09:25 +00:00
80a5e8eda8 Make upload.unturf.com's media listing page optimized by _not_ loading base64 column 2025-03-22 17:48:04 +00:00
4a7e60675b try to fix edit.
modified:   app.py
2025-03-15 18:11:38 -04:00
c4cc5ddfd6 AH! 310M files max because some audio files for books is long! 2025-02-08 20:18:01 +00:00
479e77875e allow text and application uploads (text, md, html, json, etc) 2025-01-25 11:59:42 +00:00
43d167f793 Update app.py 2025-01-24 19:02:58 +00:00
f05ad36b5d fix the envolope sender to be valid by default
modified:   app.py
2025-01-22 18:20:09 -05:00
48817d4c08 new file: .gitlab-ci.yml
modified:   app.py
2025-01-21 07:24:14 -05:00
c5cc687dcf Ok we have two working agents now as examples
modified:   .gitignore
	modified:   README.rst
	modified:   app.py
	modified:   templates/login.html.j2
	modified:   templates/verify.html.j2
	deleted:    test_agent.sh
	new file:   test_jwt_owner_agent.sh
	new file:   test_otp_cookie_agent.sh
2025-01-12 20:06:52 -05:00
5c226f2a2e JWT and complete RBAC 2025-01-12 22:54:11 +00:00
7a2a2133cf openapi for the win!
modified:   README.rst
	modified:   app.py
	new file:   openapi.yaml
2025-01-07 09:28:41 -05:00
Russell Ballestrini
596dbb923d A test_agent.sh & a README.rst
deleted:    .app.py.swp
	modified:   .gitignore
	new file:   README.rst
	modified:   app.py
	new file:   initialize_db.py
	new file:   test_agent.sh
2025-01-06 19:56:48 -05:00
d16a0f7a52 download and view buttons
modified:   app.py
	modified:   templates/list_media.html.j2
	modified:   templates/user_media.html.j2
	modified:   templates/view_media_details.html.j2
2024-12-31 08:41:52 -05:00
d7416d2bae init
new file:   .gitignore
	new file:   app.py
	new file:   requirements.txt
	new file:   templates/base.html.j2
	new file:   templates/edit_media.html.j2
	new file:   templates/home.html.j2
	new file:   templates/import_user_record.html.j2
	new file:   templates/list_media.html.j2
	new file:   templates/login.html.j2
	new file:   templates/profile.html.j2
	new file:   templates/upload_media.html.j2
	new file:   templates/user_media.html.j2
	new file:   templates/verify.html.j2
	new file:   templates/view_media.html.j2
	new file:   templates/view_media_details.html.j2
2024-12-29 15:21:59 -05:00