mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add unquarantine command to admin CLI
Summary: Adds a CLI command to un-quarantine an active document. Also tweaks the name of related environment variable to avoid a naming conflict. Test Plan: Server test. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3583
This commit is contained in:
@@ -601,12 +601,17 @@ export class DocWorkerApi {
|
||||
// is freed up for reassignment, otherwise false.
|
||||
//
|
||||
// Optionally accepts a `group` query param for updating the document's group prior
|
||||
// to (possible) reassignment. (Note: Requires special permit.)
|
||||
// to (possible) reassignment. A blank string unsets the current group, if any.
|
||||
// (Requires a special permit.)
|
||||
this._app.post('/api/docs/:docId/assign', canEdit, throttled(async (req, res) => {
|
||||
const docId = getDocId(req);
|
||||
const group = optStringParam(req.query.group);
|
||||
if (group && req.specialPermit?.action === 'assign-doc') {
|
||||
await this._docWorkerMap.updateDocGroup(docId, group);
|
||||
if (group !== undefined && req.specialPermit?.action === 'assign-doc') {
|
||||
if (group.trim() === '') {
|
||||
await this._docWorkerMap.removeDocGroup(docId);
|
||||
} else {
|
||||
await this._docWorkerMap.updateDocGroup(docId, group);
|
||||
}
|
||||
}
|
||||
const status = await this._docWorkerMap.getDocWorker(docId);
|
||||
if (!status) { res.json(false); return; }
|
||||
|
||||
@@ -66,8 +66,12 @@ export interface IDocWorkerMap extends IPermitStores, IElectionStore, IChecksumS
|
||||
getAssignments(workerId: string): Promise<string[]>;
|
||||
|
||||
getWorkerGroup(workerId: string): Promise<string|null>;
|
||||
|
||||
getDocGroup(docId: string): Promise<string|null>;
|
||||
|
||||
updateDocGroup(docId: string, docGroup: string): Promise<void>;
|
||||
|
||||
removeDocGroup(docId: string): Promise<void>;
|
||||
|
||||
getRedisClient(): RedisClient|null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user