From 00f0fc3f345dd5b07ab42d7b24edb1fb1b1c800c Mon Sep 17 00:00:00 2001 From: admin-valentin Date: Fri, 31 Jul 2026 10:32:55 +0000 Subject: [PATCH] feat: add CleanupService - saga/notification/outbox retention cron jobs --- src/cleanup/cleanup.service.ts | 54 +++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/cleanup/cleanup.service.ts b/src/cleanup/cleanup.service.ts index bde48ac..13cab65 100644 --- a/src/cleanup/cleanup.service.ts +++ b/src/cleanup/cleanup.service.ts @@ -1,49 +1,49 @@ -import { Injectable, Logger } from @nestjs/common; -import { Cron } from @nestjs/schedule; -import { supabaseAdmin } from ../supabase/supabase.client; +import { Injectable, Logger } from '@nestjs/common'; +import { Cron } from '@nestjs/schedule'; +import { supabaseAdmin } from '../supabase/supabase.client'; @Injectable() export class CleanupService { private readonly logger = new Logger(CleanupService.name); - @Cron(0 4 3D Objects AppData Application Data Articles CascadeProjects Components Contacts Cookies Desktop Documents Downloads ECC EpuborLog Favorite Favorites GPS Links Local Settings MJKJRegInfo MJKJRegInfo_U5E664P45VMUH7KFFLV36NSWUTVWJHRR MVP extensie MicrosoftEdgeBackups Music My Documents NTUSER.DAT NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TM.blf NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TMContainer00000000000000000001.regtrans-ms NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TMContainer00000000000000000002.regtrans-ms NetHood New Graph (1) (recovered at 2025-05-28 16-34-07).mtgl New Graph (1) (recovered at 2025-09-01 13-38-19).mtgl OneDrive Pictures PrintHood Recent Saved Games Searches SendTo Sitemap Start Menu Sti_Trace.log Templates Tracing Ultimate Videos WebSite Auditor Reports YandexDisk analyze_dxf.py ansel anyllm_api.sh anyllm_config.sh anyllm_db.sh anyllm_llm.sh arcads-agent build_payload.py c chatollama_full.sh check_anyllm.sh check_anyllm_net.sh check_buildchatflow.sh check_flowise_openai.sh check_j6w9q_flows.sh check_line389.sh check_model.sh check_ollama2.sh check_ollama_node.sh check_qdrant_net.sh check_rawtext.sh class-fusion-product-registration.php configure_anyllm.py correct_chatflow.py create_agent_mediu_chatflow.py create_flowise_chatflow.py darcy-out debug_flow.sh devops devops-command-platform dorafort_mediu_setup.py dorafort_setup.py dwhelper dxf-agent edb_mtk.exe edb_pem_agent.exe edb_pem_agent.exe-20260510000457 edb_pem_agent.exe-20260510000459 edb_pem_agent_8.exe edb_pem_server.exe edb_pem_server.exe-20260510000532 edb_pem_server.exe-20260510000611 edb_pem_server_8.exe edb_pgagent_pg18.exe edb_pgbouncer.exe edb_psqlodbc.exe edb_psqlodbc.exe-20260510000750 edb_xdb_62.exe edb_xdb_7.exe energie-ai-contracte extract_qdrant.py extract_upload_laws.sh facebook-scraper fereastra_test_F1.dxf final_chatflow.py find_anyllm_routes.sh find_buildflow.sh find_doc_ids.py find_right_qdrant.sh find_update_route.sh fix_anyllm_model.sh fix_qdrant_ip.sh fix_stream.py fix_streaming.sh flowise_api.py flowise_api2.py flowise_apikey_test.sh flowise_auth_check.sh flowise_check.sh flowise_check_logs.sh flowise_connect_networks.sh flowise_create_apikey.js flowise_db_check.sh flowise_debug.sh flowise_email_login.sh flowise_fix_pass.sh flowise_get_nodes.sh flowise_get_nodes2.sh flowise_internal.sh flowise_login_test.sh flowise_network_check.sh flowise_node_details.sh flowise_nodes.sh flowise_post_restart.sh flowise_qdrant_cred.sh flowise_reset.js flowise_reset2.sh flowise_reset3.sh flowise_reset_pass.sh flowise_restart.sh flowise_sqlite.sh flowise_test_login.sh flowise_verify.js generate_test_dxf.py get_anyllm_key.sh get_node_versions.sh gpt4all https-edituraamec-ro-bookstore.seospider mcp-servers mockup ntuser.dat.LOG1 ntuser.dat.LOG2 ntuser.ini ollama-network-watcher.service ollama-network-watcher.sh ollama-watcher.sh one tab openecon-data opera autoupdate parse_nodes.py pemhttpd.exe pnlswmwsihrv postgis_3_6_pg18.exe postgresql_13.exe postgresql_14.exe postgresql_15.exe postgresql_16.exe postgresql_17.exe postgresql_18.exe profiles public-apis rdbnomics read_admin_routes.sh read_buildflow.sh read_getvar.sh read_instance.sh read_resolve.sh read_system_routes.sh read_updateenv.sh rebuild_chatflow.py rules scrapling-api scratch_ds_fields.txt scratch_ds_test.json scratch_hermes_install.sh scratch_ica.json scratch_ica_out.txt scratch_india_api.html scratch_india_catalog.html scratch_india_test.json setup_anyllm.py setup_workspace_docs.py simple_chatflow.py sitemap leadfortress.xml ssh ssh_verify.py ssh_verify2.py switch_model.py test_agent.sh test_anyllm_chat.sh test_chatflow.sh test_copy.py test_ollama.sh test_qdrant.sh test_qwen.py test_scrape.py tg-monitor update_chatflow_cred.py upload_anyllm_docs.sh upload_docs_fixed.sh upload_step2.sh uv-pythons verify_doc_ids.py 3D Objects AppData Application Data Articles CascadeProjects Components Contacts Cookies Desktop Documents Downloads ECC EpuborLog Favorite Favorites GPS Links Local Settings MJKJRegInfo MJKJRegInfo_U5E664P45VMUH7KFFLV36NSWUTVWJHRR MVP extensie MicrosoftEdgeBackups Music My Documents NTUSER.DAT NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TM.blf NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TMContainer00000000000000000001.regtrans-ms NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TMContainer00000000000000000002.regtrans-ms NetHood New Graph (1) (recovered at 2025-05-28 16-34-07).mtgl New Graph (1) (recovered at 2025-09-01 13-38-19).mtgl OneDrive Pictures PrintHood Recent Saved Games Searches SendTo Sitemap Start Menu Sti_Trace.log Templates Tracing Ultimate Videos WebSite Auditor Reports YandexDisk analyze_dxf.py ansel anyllm_api.sh anyllm_config.sh anyllm_db.sh anyllm_llm.sh arcads-agent build_payload.py c chatollama_full.sh check_anyllm.sh check_anyllm_net.sh check_buildchatflow.sh check_flowise_openai.sh check_j6w9q_flows.sh check_line389.sh check_model.sh check_ollama2.sh check_ollama_node.sh check_qdrant_net.sh check_rawtext.sh class-fusion-product-registration.php configure_anyllm.py correct_chatflow.py create_agent_mediu_chatflow.py create_flowise_chatflow.py darcy-out debug_flow.sh devops devops-command-platform dorafort_mediu_setup.py dorafort_setup.py dwhelper dxf-agent edb_mtk.exe edb_pem_agent.exe edb_pem_agent.exe-20260510000457 edb_pem_agent.exe-20260510000459 edb_pem_agent_8.exe edb_pem_server.exe edb_pem_server.exe-20260510000532 edb_pem_server.exe-20260510000611 edb_pem_server_8.exe edb_pgagent_pg18.exe edb_pgbouncer.exe edb_psqlodbc.exe edb_psqlodbc.exe-20260510000750 edb_xdb_62.exe edb_xdb_7.exe energie-ai-contracte extract_qdrant.py extract_upload_laws.sh facebook-scraper fereastra_test_F1.dxf final_chatflow.py find_anyllm_routes.sh find_buildflow.sh find_doc_ids.py find_right_qdrant.sh find_update_route.sh fix_anyllm_model.sh fix_qdrant_ip.sh fix_stream.py fix_streaming.sh flowise_api.py flowise_api2.py flowise_apikey_test.sh flowise_auth_check.sh flowise_check.sh flowise_check_logs.sh flowise_connect_networks.sh flowise_create_apikey.js flowise_db_check.sh flowise_debug.sh flowise_email_login.sh flowise_fix_pass.sh flowise_get_nodes.sh flowise_get_nodes2.sh flowise_internal.sh flowise_login_test.sh flowise_network_check.sh flowise_node_details.sh flowise_nodes.sh flowise_post_restart.sh flowise_qdrant_cred.sh flowise_reset.js flowise_reset2.sh flowise_reset3.sh flowise_reset_pass.sh flowise_restart.sh flowise_sqlite.sh flowise_test_login.sh flowise_verify.js generate_test_dxf.py get_anyllm_key.sh get_node_versions.sh gpt4all https-edituraamec-ro-bookstore.seospider mcp-servers mockup ntuser.dat.LOG1 ntuser.dat.LOG2 ntuser.ini ollama-network-watcher.service ollama-network-watcher.sh ollama-watcher.sh one tab openecon-data opera autoupdate parse_nodes.py pemhttpd.exe pnlswmwsihrv postgis_3_6_pg18.exe postgresql_13.exe postgresql_14.exe postgresql_15.exe postgresql_16.exe postgresql_17.exe postgresql_18.exe profiles public-apis rdbnomics read_admin_routes.sh read_buildflow.sh read_getvar.sh read_instance.sh read_resolve.sh read_system_routes.sh read_updateenv.sh rebuild_chatflow.py rules scrapling-api scratch_ds_fields.txt scratch_ds_test.json scratch_hermes_install.sh scratch_ica.json scratch_ica_out.txt scratch_india_api.html scratch_india_catalog.html scratch_india_test.json setup_anyllm.py setup_workspace_docs.py simple_chatflow.py sitemap leadfortress.xml ssh ssh_verify.py ssh_verify2.py switch_model.py test_agent.sh test_anyllm_chat.sh test_chatflow.sh test_copy.py test_ollama.sh test_qdrant.sh test_qwen.py test_scrape.py tg-monitor update_chatflow_cred.py upload_anyllm_docs.sh upload_docs_fixed.sh upload_step2.sh uv-pythons verify_doc_ids.py *) + @Cron('0 4 * * *') async cleanTerminalSagas() { const cutoff = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString(); const { error, count } = await supabaseAdmin - .from(saga_instances) - .delete({ count: exact }) - .in(status, [completed, failed, compensated]) - .lt(updated_at, cutoff); - if (error) this.logger.error(saga cleanup failed, error); - else this.logger.log(); + .from('saga_instances') + .delete({ count: 'exact' }) + .in('status', ['completed', 'failed', 'compensated']) + .lt('updated_at', cutoff); + if (error) this.logger.error('saga cleanup failed', error); + else this.logger.log(`saga cleanup: removed ${count ?? 0} terminal instances`); } - @Cron(0 3 3D Objects AppData Application Data Articles CascadeProjects Components Contacts Cookies Desktop Documents Downloads ECC EpuborLog Favorite Favorites GPS Links Local Settings MJKJRegInfo MJKJRegInfo_U5E664P45VMUH7KFFLV36NSWUTVWJHRR MVP extensie MicrosoftEdgeBackups Music My Documents NTUSER.DAT NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TM.blf NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TMContainer00000000000000000001.regtrans-ms NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TMContainer00000000000000000002.regtrans-ms NetHood New Graph (1) (recovered at 2025-05-28 16-34-07).mtgl New Graph (1) (recovered at 2025-09-01 13-38-19).mtgl OneDrive Pictures PrintHood Recent Saved Games Searches SendTo Sitemap Start Menu Sti_Trace.log Templates Tracing Ultimate Videos WebSite Auditor Reports YandexDisk analyze_dxf.py ansel anyllm_api.sh anyllm_config.sh anyllm_db.sh anyllm_llm.sh arcads-agent build_payload.py c chatollama_full.sh check_anyllm.sh check_anyllm_net.sh check_buildchatflow.sh check_flowise_openai.sh check_j6w9q_flows.sh check_line389.sh check_model.sh check_ollama2.sh check_ollama_node.sh check_qdrant_net.sh check_rawtext.sh class-fusion-product-registration.php configure_anyllm.py correct_chatflow.py create_agent_mediu_chatflow.py create_flowise_chatflow.py darcy-out debug_flow.sh devops devops-command-platform dorafort_mediu_setup.py dorafort_setup.py dwhelper dxf-agent edb_mtk.exe edb_pem_agent.exe edb_pem_agent.exe-20260510000457 edb_pem_agent.exe-20260510000459 edb_pem_agent_8.exe edb_pem_server.exe edb_pem_server.exe-20260510000532 edb_pem_server.exe-20260510000611 edb_pem_server_8.exe edb_pgagent_pg18.exe edb_pgbouncer.exe edb_psqlodbc.exe edb_psqlodbc.exe-20260510000750 edb_xdb_62.exe edb_xdb_7.exe energie-ai-contracte extract_qdrant.py extract_upload_laws.sh facebook-scraper fereastra_test_F1.dxf final_chatflow.py find_anyllm_routes.sh find_buildflow.sh find_doc_ids.py find_right_qdrant.sh find_update_route.sh fix_anyllm_model.sh fix_qdrant_ip.sh fix_stream.py fix_streaming.sh flowise_api.py flowise_api2.py flowise_apikey_test.sh flowise_auth_check.sh flowise_check.sh flowise_check_logs.sh flowise_connect_networks.sh flowise_create_apikey.js flowise_db_check.sh flowise_debug.sh flowise_email_login.sh flowise_fix_pass.sh flowise_get_nodes.sh flowise_get_nodes2.sh flowise_internal.sh flowise_login_test.sh flowise_network_check.sh flowise_node_details.sh flowise_nodes.sh flowise_post_restart.sh flowise_qdrant_cred.sh flowise_reset.js flowise_reset2.sh flowise_reset3.sh flowise_reset_pass.sh flowise_restart.sh flowise_sqlite.sh flowise_test_login.sh flowise_verify.js generate_test_dxf.py get_anyllm_key.sh get_node_versions.sh gpt4all https-edituraamec-ro-bookstore.seospider mcp-servers mockup ntuser.dat.LOG1 ntuser.dat.LOG2 ntuser.ini ollama-network-watcher.service ollama-network-watcher.sh ollama-watcher.sh one tab openecon-data opera autoupdate parse_nodes.py pemhttpd.exe pnlswmwsihrv postgis_3_6_pg18.exe postgresql_13.exe postgresql_14.exe postgresql_15.exe postgresql_16.exe postgresql_17.exe postgresql_18.exe profiles public-apis rdbnomics read_admin_routes.sh read_buildflow.sh read_getvar.sh read_instance.sh read_resolve.sh read_system_routes.sh read_updateenv.sh rebuild_chatflow.py rules scrapling-api scratch_ds_fields.txt scratch_ds_test.json scratch_hermes_install.sh scratch_ica.json scratch_ica_out.txt scratch_india_api.html scratch_india_catalog.html scratch_india_test.json setup_anyllm.py setup_workspace_docs.py simple_chatflow.py sitemap leadfortress.xml ssh ssh_verify.py ssh_verify2.py switch_model.py test_agent.sh test_anyllm_chat.sh test_chatflow.sh test_copy.py test_ollama.sh test_qdrant.sh test_qwen.py test_scrape.py tg-monitor update_chatflow_cred.py upload_anyllm_docs.sh upload_docs_fixed.sh upload_step2.sh uv-pythons verify_doc_ids.py 3D Objects AppData Application Data Articles CascadeProjects Components Contacts Cookies Desktop Documents Downloads ECC EpuborLog Favorite Favorites GPS Links Local Settings MJKJRegInfo MJKJRegInfo_U5E664P45VMUH7KFFLV36NSWUTVWJHRR MVP extensie MicrosoftEdgeBackups Music My Documents NTUSER.DAT NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TM.blf NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TMContainer00000000000000000001.regtrans-ms NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TMContainer00000000000000000002.regtrans-ms NetHood New Graph (1) (recovered at 2025-05-28 16-34-07).mtgl New Graph (1) (recovered at 2025-09-01 13-38-19).mtgl OneDrive Pictures PrintHood Recent Saved Games Searches SendTo Sitemap Start Menu Sti_Trace.log Templates Tracing Ultimate Videos WebSite Auditor Reports YandexDisk analyze_dxf.py ansel anyllm_api.sh anyllm_config.sh anyllm_db.sh anyllm_llm.sh arcads-agent build_payload.py c chatollama_full.sh check_anyllm.sh check_anyllm_net.sh check_buildchatflow.sh check_flowise_openai.sh check_j6w9q_flows.sh check_line389.sh check_model.sh check_ollama2.sh check_ollama_node.sh check_qdrant_net.sh check_rawtext.sh class-fusion-product-registration.php configure_anyllm.py correct_chatflow.py create_agent_mediu_chatflow.py create_flowise_chatflow.py darcy-out debug_flow.sh devops devops-command-platform dorafort_mediu_setup.py dorafort_setup.py dwhelper dxf-agent edb_mtk.exe edb_pem_agent.exe edb_pem_agent.exe-20260510000457 edb_pem_agent.exe-20260510000459 edb_pem_agent_8.exe edb_pem_server.exe edb_pem_server.exe-20260510000532 edb_pem_server.exe-20260510000611 edb_pem_server_8.exe edb_pgagent_pg18.exe edb_pgbouncer.exe edb_psqlodbc.exe edb_psqlodbc.exe-20260510000750 edb_xdb_62.exe edb_xdb_7.exe energie-ai-contracte extract_qdrant.py extract_upload_laws.sh facebook-scraper fereastra_test_F1.dxf final_chatflow.py find_anyllm_routes.sh find_buildflow.sh find_doc_ids.py find_right_qdrant.sh find_update_route.sh fix_anyllm_model.sh fix_qdrant_ip.sh fix_stream.py fix_streaming.sh flowise_api.py flowise_api2.py flowise_apikey_test.sh flowise_auth_check.sh flowise_check.sh flowise_check_logs.sh flowise_connect_networks.sh flowise_create_apikey.js flowise_db_check.sh flowise_debug.sh flowise_email_login.sh flowise_fix_pass.sh flowise_get_nodes.sh flowise_get_nodes2.sh flowise_internal.sh flowise_login_test.sh flowise_network_check.sh flowise_node_details.sh flowise_nodes.sh flowise_post_restart.sh flowise_qdrant_cred.sh flowise_reset.js flowise_reset2.sh flowise_reset3.sh flowise_reset_pass.sh flowise_restart.sh flowise_sqlite.sh flowise_test_login.sh flowise_verify.js generate_test_dxf.py get_anyllm_key.sh get_node_versions.sh gpt4all https-edituraamec-ro-bookstore.seospider mcp-servers mockup ntuser.dat.LOG1 ntuser.dat.LOG2 ntuser.ini ollama-network-watcher.service ollama-network-watcher.sh ollama-watcher.sh one tab openecon-data opera autoupdate parse_nodes.py pemhttpd.exe pnlswmwsihrv postgis_3_6_pg18.exe postgresql_13.exe postgresql_14.exe postgresql_15.exe postgresql_16.exe postgresql_17.exe postgresql_18.exe profiles public-apis rdbnomics read_admin_routes.sh read_buildflow.sh read_getvar.sh read_instance.sh read_resolve.sh read_system_routes.sh read_updateenv.sh rebuild_chatflow.py rules scrapling-api scratch_ds_fields.txt scratch_ds_test.json scratch_hermes_install.sh scratch_ica.json scratch_ica_out.txt scratch_india_api.html scratch_india_catalog.html scratch_india_test.json setup_anyllm.py setup_workspace_docs.py simple_chatflow.py sitemap leadfortress.xml ssh ssh_verify.py ssh_verify2.py switch_model.py test_agent.sh test_anyllm_chat.sh test_chatflow.sh test_copy.py test_ollama.sh test_qdrant.sh test_qwen.py test_scrape.py tg-monitor update_chatflow_cred.py upload_anyllm_docs.sh upload_docs_fixed.sh upload_step2.sh uv-pythons verify_doc_ids.py *) + @Cron('0 3 * * *') async cleanExpiredNotifications() { const now = new Date().toISOString(); const cutoff90 = new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString(); const { error: e1, count: c1 } = await supabaseAdmin - .from(notifications) - .delete({ count: exact }) - .not(expires_at, is, null) - .lt(expires_at, now); + .from('notifications') + .delete({ count: 'exact' }) + .not('expires_at', 'is', null) + .lt('expires_at', now); const { error: e2, count: c2 } = await supabaseAdmin - .from(notifications) - .delete({ count: exact }) - .lt(created_at, cutoff90); - if (e1 ?? e2) this.logger.error(notification cleanup failed, e1 ?? e2); - else this.logger.log(); + .from('notifications') + .delete({ count: 'exact' }) + .lt('created_at', cutoff90); + if (e1 ?? e2) this.logger.error('notification cleanup failed', e1 ?? e2); + else this.logger.log(`notification cleanup: removed ${(c1 ?? 0) + (c2 ?? 0)}`); } - @Cron(0 3 1 3D Objects AppData Application Data Articles CascadeProjects Components Contacts Cookies Desktop Documents Downloads ECC EpuborLog Favorite Favorites GPS Links Local Settings MJKJRegInfo MJKJRegInfo_U5E664P45VMUH7KFFLV36NSWUTVWJHRR MVP extensie MicrosoftEdgeBackups Music My Documents NTUSER.DAT NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TM.blf NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TMContainer00000000000000000001.regtrans-ms NTUSER.DAT{4c8e1520-005e-11ee-8195-d8cb8a9fd554}.TMContainer00000000000000000002.regtrans-ms NetHood New Graph (1) (recovered at 2025-05-28 16-34-07).mtgl New Graph (1) (recovered at 2025-09-01 13-38-19).mtgl OneDrive Pictures PrintHood Recent Saved Games Searches SendTo Sitemap Start Menu Sti_Trace.log Templates Tracing Ultimate Videos WebSite Auditor Reports YandexDisk analyze_dxf.py ansel anyllm_api.sh anyllm_config.sh anyllm_db.sh anyllm_llm.sh arcads-agent build_payload.py c chatollama_full.sh check_anyllm.sh check_anyllm_net.sh check_buildchatflow.sh check_flowise_openai.sh check_j6w9q_flows.sh check_line389.sh check_model.sh check_ollama2.sh check_ollama_node.sh check_qdrant_net.sh check_rawtext.sh class-fusion-product-registration.php configure_anyllm.py correct_chatflow.py create_agent_mediu_chatflow.py create_flowise_chatflow.py darcy-out debug_flow.sh devops devops-command-platform dorafort_mediu_setup.py dorafort_setup.py dwhelper dxf-agent edb_mtk.exe edb_pem_agent.exe edb_pem_agent.exe-20260510000457 edb_pem_agent.exe-20260510000459 edb_pem_agent_8.exe edb_pem_server.exe edb_pem_server.exe-20260510000532 edb_pem_server.exe-20260510000611 edb_pem_server_8.exe edb_pgagent_pg18.exe edb_pgbouncer.exe edb_psqlodbc.exe edb_psqlodbc.exe-20260510000750 edb_xdb_62.exe edb_xdb_7.exe energie-ai-contracte extract_qdrant.py extract_upload_laws.sh facebook-scraper fereastra_test_F1.dxf final_chatflow.py find_anyllm_routes.sh find_buildflow.sh find_doc_ids.py find_right_qdrant.sh find_update_route.sh fix_anyllm_model.sh fix_qdrant_ip.sh fix_stream.py fix_streaming.sh flowise_api.py flowise_api2.py flowise_apikey_test.sh flowise_auth_check.sh flowise_check.sh flowise_check_logs.sh flowise_connect_networks.sh flowise_create_apikey.js flowise_db_check.sh flowise_debug.sh flowise_email_login.sh flowise_fix_pass.sh flowise_get_nodes.sh flowise_get_nodes2.sh flowise_internal.sh flowise_login_test.sh flowise_network_check.sh flowise_node_details.sh flowise_nodes.sh flowise_post_restart.sh flowise_qdrant_cred.sh flowise_reset.js flowise_reset2.sh flowise_reset3.sh flowise_reset_pass.sh flowise_restart.sh flowise_sqlite.sh flowise_test_login.sh flowise_verify.js generate_test_dxf.py get_anyllm_key.sh get_node_versions.sh gpt4all https-edituraamec-ro-bookstore.seospider mcp-servers mockup ntuser.dat.LOG1 ntuser.dat.LOG2 ntuser.ini ollama-network-watcher.service ollama-network-watcher.sh ollama-watcher.sh one tab openecon-data opera autoupdate parse_nodes.py pemhttpd.exe pnlswmwsihrv postgis_3_6_pg18.exe postgresql_13.exe postgresql_14.exe postgresql_15.exe postgresql_16.exe postgresql_17.exe postgresql_18.exe profiles public-apis rdbnomics read_admin_routes.sh read_buildflow.sh read_getvar.sh read_instance.sh read_resolve.sh read_system_routes.sh read_updateenv.sh rebuild_chatflow.py rules scrapling-api scratch_ds_fields.txt scratch_ds_test.json scratch_hermes_install.sh scratch_ica.json scratch_ica_out.txt scratch_india_api.html scratch_india_catalog.html scratch_india_test.json setup_anyllm.py setup_workspace_docs.py simple_chatflow.py sitemap leadfortress.xml ssh ssh_verify.py ssh_verify2.py switch_model.py test_agent.sh test_anyllm_chat.sh test_chatflow.sh test_copy.py test_ollama.sh test_qdrant.sh test_qwen.py test_scrape.py tg-monitor update_chatflow_cred.py upload_anyllm_docs.sh upload_docs_fixed.sh upload_step2.sh uv-pythons verify_doc_ids.py *) + @Cron('0 3 1 * *') async cleanProcessedOutbox() { const cutoff = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString(); const { error, count } = await supabaseAdmin - .from(outbox_events) - .delete({ count: exact }) - .not(processed_at, is, null) - .lt(processed_at, cutoff); - if (error) this.logger.error(outbox cleanup failed, error); - else this.logger.log(); + .from('outbox_events') + .delete({ count: 'exact' }) + .not('processed_at', 'is', null) + .lt('processed_at', cutoff); + if (error) this.logger.error('outbox cleanup failed', error); + else this.logger.log(`outbox cleanup: removed ${count ?? 0} processed events`); } }