mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-11 00:08:30 +01:00
docs: maintanance mode impact (#3858)
This commit is contained in:
parent
ed4eff71fe
commit
78715e3374
44
src/lib/services/maintenance-service.test.ts
Normal file
44
src/lib/services/maintenance-service.test.ts
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import { SchedulerService } from './scheduler-service';
|
||||||
|
import MaintenanceService from './maintenance-service';
|
||||||
|
import { IUnleashStores } from '../types';
|
||||||
|
import SettingService from './setting-service';
|
||||||
|
import { createTestConfig } from '../../test/config/test-config';
|
||||||
|
|
||||||
|
test('Maintenance on should pause scheduler', async () => {
|
||||||
|
const config = createTestConfig();
|
||||||
|
const schedulerService = new SchedulerService(config.getLogger);
|
||||||
|
const maintenanceService = new MaintenanceService(
|
||||||
|
{} as IUnleashStores,
|
||||||
|
config,
|
||||||
|
{ insert() {} } as unknown as SettingService,
|
||||||
|
schedulerService,
|
||||||
|
);
|
||||||
|
|
||||||
|
await maintenanceService.toggleMaintenanceMode(
|
||||||
|
{ enabled: true },
|
||||||
|
'irrelevant user',
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(schedulerService.getMode()).toBe('paused');
|
||||||
|
schedulerService.stop();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Maintenance off should resume scheduler', async () => {
|
||||||
|
const config = createTestConfig();
|
||||||
|
const schedulerService = new SchedulerService(config.getLogger);
|
||||||
|
schedulerService.pause();
|
||||||
|
const maintenanceService = new MaintenanceService(
|
||||||
|
{} as IUnleashStores,
|
||||||
|
config,
|
||||||
|
{ insert() {} } as unknown as SettingService,
|
||||||
|
schedulerService,
|
||||||
|
);
|
||||||
|
|
||||||
|
await maintenanceService.toggleMaintenanceMode(
|
||||||
|
{ enabled: false },
|
||||||
|
'irrelevant user',
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(schedulerService.getMode()).toBe('active');
|
||||||
|
schedulerService.stop();
|
||||||
|
});
|
@ -25,3 +25,18 @@ Maintenance mode is controlled from the "maintenance" section of the Unleash adm
|
|||||||
When maintenance mode is enabled, a warning banner appears at the top of the Unleash dashboard, indicating that any changes made during this period will not be saved and may result in errors.
|
When maintenance mode is enabled, a warning banner appears at the top of the Unleash dashboard, indicating that any changes made during this period will not be saved and may result in errors.
|
||||||
|
|
||||||
![Maintenance mode banner when maintenance mod is toggled on](/img/maintenance-banner.png)
|
![Maintenance mode banner when maintenance mod is toggled on](/img/maintenance-banner.png)
|
||||||
|
|
||||||
|
## Maintenance mode and scheduled jobs
|
||||||
|
|
||||||
|
When maintenance mode is enabled all internal jobs performed by Unleash such as updating metrics and statistics are paused. When maintenance mode is toggled back to disabled later, all scheduled
|
||||||
|
jobs are resumed.
|
||||||
|
|
||||||
|
## Maintenance mode and read-only DB user
|
||||||
|
|
||||||
|
When maintenance mode is enabled most DB operations are suspended so you can use even read-only DB user. There's one exception though.
|
||||||
|
Unleash DB user role needs a DELETE and UPDATE permission on the unleash_session table.
|
||||||
|
|
||||||
|
```
|
||||||
|
GRANT DELETE ON unleash_session TO my_db_role;
|
||||||
|
GRANT UPDATE ON unleash_session TO my_db_role;
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user