* feat: add server settings for default board, default color scheme and default locale * chore: address pull request feedback * test: adjust unit tests to match requirements * fix: deepsource issue * chore: add deepsource as dependency to translation library * refactor: restructure language-combobox, adjust default locale for next-intl * chore: change cookie keys prefix from homarr- to homarr.
19 lines
561 B
TypeScript
19 lines
561 B
TypeScript
import { sendServerAnalyticsAsync } from "@homarr/analytics";
|
|
import { EVERY_WEEK } from "@homarr/cron-jobs-core/expressions";
|
|
import { db } from "@homarr/db";
|
|
import { getServerSettingByKeyAsync } from "@homarr/db/queries";
|
|
|
|
import { createCronJob } from "../lib";
|
|
|
|
export const analyticsJob = createCronJob("analytics", EVERY_WEEK, {
|
|
runOnStart: true,
|
|
}).withCallback(async () => {
|
|
const analyticSetting = await getServerSettingByKeyAsync(db, "analytics");
|
|
|
|
if (!analyticSetting.enableGeneral) {
|
|
return;
|
|
}
|
|
|
|
await sendServerAnalyticsAsync();
|
|
});
|