mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
fix(cli): 🐛 Don't federate changes to remote users, initialize search indexer on all CLI commands
This commit is contained in:
parent
49a2552e96
commit
57b295ccf2
5 changed files with 29 additions and 20 deletions
|
|
@ -33,8 +33,6 @@ export default class IndexRebuild extends BaseCommand<typeof IndexRebuild> {
|
|||
this.exit(1);
|
||||
}
|
||||
|
||||
await searchManager.connect();
|
||||
|
||||
const spinner = ora("Rebuilding search indexes").start();
|
||||
|
||||
switch (args.type) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import confirm from "@inquirer/confirm";
|
||||
import { Flags } from "@oclif/core";
|
||||
import chalk from "chalk";
|
||||
import ora from "ora";
|
||||
import { UserFinderCommand } from "~/cli/classes";
|
||||
import { formatArray } from "~/cli/utils/format";
|
||||
|
||||
|
|
@ -78,8 +79,11 @@ export default class UserRefetch extends UserFinderCommand<typeof UserRefetch> {
|
|||
}
|
||||
}
|
||||
|
||||
const spinner = ora("Refetching users").start();
|
||||
|
||||
for (const user of users) {
|
||||
try {
|
||||
spinner.text = `Refetching user ${user.data.username}`;
|
||||
await user.updateFromRemote();
|
||||
} catch (error) {
|
||||
this.log(
|
||||
|
|
@ -93,6 +97,8 @@ export default class UserRefetch extends UserFinderCommand<typeof UserRefetch> {
|
|||
}
|
||||
}
|
||||
|
||||
spinner.succeed("Refetched users");
|
||||
|
||||
this.exit(0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue