mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 15:15:44 -03:00
perf(usage-stats): prevent unnecessary writes when idle
- Add is_dirty flag to track if statistics have changed - Only write stats file when data actually changes - Add enable_usage_statistics setting in ComfyUI settings - Skip backend requests when usage statistics is disabled - Fix standalone mode compatibility for MetadataRegistry Fixes #826
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { app } from "../../scripts/app.js";
|
||||
import { api } from "../../scripts/api.js";
|
||||
import { showToast } from "./utils.js";
|
||||
import { getAutoPathCorrectionPreference } from "./settings.js";
|
||||
import { getAutoPathCorrectionPreference, getUsageStatisticsPreference } from "./settings.js";
|
||||
|
||||
// Define target nodes and their widget configurations
|
||||
const PATH_CORRECTION_TARGETS = [
|
||||
@@ -25,6 +25,11 @@ app.registerExtension({
|
||||
setup() {
|
||||
// Listen for successful executions
|
||||
api.addEventListener("execution_success", ({ detail }) => {
|
||||
// Skip if usage statistics is disabled
|
||||
if (!getUsageStatisticsPreference()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (detail && detail.prompt_id) {
|
||||
this.updateUsageStats(detail.prompt_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user