Debounce changed to seconds.

This commit is contained in:
Vassili Minaev 2026-05-12 18:34:31 -06:00
parent 43c630c1f7
commit 642d74c9f8
2 changed files with 7 additions and 7 deletions

View file

@ -41,7 +41,7 @@ function scheduleSnapshotPush(actor) {
let debouncer = snapshotDebouncers.get(actor.id); let debouncer = snapshotDebouncers.get(actor.id);
if (!debouncer) { if (!debouncer) {
const debounceMs = game.settings.get(MODULE_ID, "snapshotDebounceMs"); const debounceMs = game.settings.get(MODULE_ID, "snapshotDebounceSeconds") * 1000;
debouncer = foundry.utils.debounce((a) => { debouncer = foundry.utils.debounce((a) => {
pushSnapshot(a).catch((err) => { pushSnapshot(a).catch((err) => {
console.warn(`[${MODULE_ID}] snapshot push for ${a.name} failed:`, err); console.warn(`[${MODULE_ID}] snapshot push for ${a.name} failed:`, err);

View file

@ -14,11 +14,11 @@ import { MODULE_ID } from "./constants.js";
export function registerSettings() { export function registerSettings() {
game.settings.register(MODULE_ID, "frappeBaseUrl", { game.settings.register(MODULE_ID, "frappeBaseUrl", {
name: "Frappe Base URL", name: "Frappe Base URL",
hint: "Base URL of your Seitime Frappe site, e.g. https://seitime.vassi.li (no trailing slash).", hint: "Base URL of your Seitime Frappe site, e.g. https://seitimegames.com (no trailing slash).",
scope: "world", scope: "world",
config: true, config: true,
type: String, type: String,
default: "", default: "https://seitimegames.com",
}); });
game.settings.register(MODULE_ID, "sharedSecret", { game.settings.register(MODULE_ID, "sharedSecret", {
@ -50,14 +50,14 @@ export function registerSettings() {
range: { min: 0, max: 120, step: 1 }, range: { min: 0, max: 120, step: 1 },
}); });
game.settings.register(MODULE_ID, "snapshotDebounceMs", { game.settings.register(MODULE_ID, "snapshotDebounceSeconds", {
name: "Snapshot Debounce (ms)", name: "Snapshot Debounce (seconds)",
hint: "How long to wait after the last actor edit before pushing a snapshot. Combat causes frequent edits, so a few seconds is usually right.", hint: "How long to wait after the last actor edit before pushing a snapshot. Combat causes frequent edits, so a few seconds is usually right.",
scope: "world", scope: "world",
config: true, config: true,
type: Number, type: Number,
default: 5000, default: 5,
range: { min: 500, max: 60000, step: 500 }, range: { min: 1, max: 60, step: 1 },
}); });
game.settings.register(MODULE_ID, "snapshotAutoSync", { game.settings.register(MODULE_ID, "snapshotAutoSync", {