feat: added elastic search script to mastodon

This commit is contained in:
Nick 2025-12-02 15:30:13 -06:00
parent 11e51030e0
commit 2d551d716c

View file

@ -270,6 +270,23 @@ in
mastodon-sidekiq-mailers.serviceConfig.PrivateMounts = lib.mkForce false;
mastodon-sidekiq-push-pull.serviceConfig.PrivateMounts = lib.mkForce false;
mastodon-elastic-search = {
description = "Recache elastic search";
after = [
"network-online.target"
"mastodon-web.service"
];
wants = [ "network-online.target" ];
serviceConfig = {
WorkingDirectory = "/var/lib/${serviceCfg.name}";
Type = "oneshot";
# Remove RemainAfterExit for recurring tasks
};
script = ''
mastodon-tootctl search deploy --only-mapping --only=instances accounts tags statuses public_statuses
'';
};
mastodon-copy-secrets = {
description = "Copy secrets from virtiofs to local filesystem";
before = [ "mastodon-init-dirs.service" ];
@ -364,16 +381,27 @@ in
'';
};
};
timers.fedifetcher = {
description = "Timer for FediFetcher";
wantedBy = [ "timers.target" ];
timers = {
mastodon-elastic-search = {
description = "Timer for Mastodon elastic search recaching";
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "10min";
OnUnitActiveSec = "60min";
Unit = "mastodon-elastic-search.service";
};
};
timerConfig = {
OnBootSec = "10min";
OnUnitActiveSec = "15min";
Unit = "fedifetcher.service";
Persistent = true;
AccuracySec = "1min";
fedifetcher = {
description = "Timer for FediFetcher";
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "10min";
OnUnitActiveSec = "15min";
Unit = "fedifetcher.service";
Persistent = true;
AccuracySec = "1min";
};
};
};