mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
feat: add announcement channels, publishing and following (#3090)
This commit is contained in:
1 parent
376afd2ad6
commit
7e4d5137f8
381 files changed
+45650
-14076
No files matched your search
@@ -405,7 +405,7 @@ function validateApiWorkerConfig(config: MasterConfig): void {
|
||||
assertOneOf(worker.mode, ['all_lanes', 'single_lane', 'single_task'], 'FLUXER_API_WORKER_MODE');
|
||||
}
|
||||
if (worker.lane !== undefined) {
|
||||
assertOneOf(worker.lane, ['realtime', 'unfurl', 'lifecycle', 'batch'], 'FLUXER_API_WORKER_LANE');
|
||||
assertOneOf(worker.lane, ['realtime', 'unfurl', 'lifecycle', 'batch', 'crosspost'], 'FLUXER_API_WORKER_LANE');
|
||||
}
|
||||
if (worker.mode === 'single_task') {
|
||||
requireString(worker.task, 'FLUXER_API_WORKER_TASK');
|
||||
|
||||
@@ -92,7 +92,7 @@ export interface MasterConfig {
|
||||
app_origin_aliases: Array<string>;
|
||||
worker?: {
|
||||
mode?: 'all_lanes' | 'single_lane' | 'single_task';
|
||||
lane?: 'realtime' | 'unfurl' | 'lifecycle' | 'batch';
|
||||
lane?: 'realtime' | 'unfurl' | 'lifecycle' | 'batch' | 'crosspost';
|
||||
task?: string;
|
||||
enable_cron_scheduler?: boolean;
|
||||
lane_concurrency_overrides?: {
|
||||
@@ -100,6 +100,7 @@ export interface MasterConfig {
|
||||
unfurl?: number;
|
||||
lifecycle?: number;
|
||||
batch?: number;
|
||||
crosspost?: number;
|
||||
};
|
||||
};
|
||||
storage_change_feed?: {
|
||||
|
||||
@@ -343,6 +343,22 @@ describe('ConfigLoader', () => {
|
||||
expect(config.services.gateway).not.toHaveProperty('push_enabled');
|
||||
});
|
||||
|
||||
test('accepts the crosspost worker lane', async () => {
|
||||
stubMinimalEnv({
|
||||
FLUXER_API_WORKER_MODE: 'single_lane',
|
||||
FLUXER_API_WORKER_LANE: 'crosspost',
|
||||
FLUXER_API_WORKER_LANE_CONCURRENCY_OVERRIDES: '{"crosspost":4}',
|
||||
});
|
||||
const config = await loadConfig();
|
||||
expect(config.services.api.worker?.lane).toBe('crosspost');
|
||||
expect(config.services.api.worker?.lane_concurrency_overrides?.crosspost).toBe(4);
|
||||
});
|
||||
|
||||
test('rejects an unknown worker lane', async () => {
|
||||
stubMinimalEnv({FLUXER_API_WORKER_MODE: 'single_lane', FLUXER_API_WORKER_LANE: 'publishing'});
|
||||
await expect(loadConfig()).rejects.toThrow('FLUXER_API_WORKER_LANE');
|
||||
});
|
||||
|
||||
test('rejects single task worker mode without task env', async () => {
|
||||
stubMinimalEnv({FLUXER_API_WORKER_MODE: 'single_task'});
|
||||
await expect(loadConfig()).rejects.toThrow('FLUXER_API_WORKER_TASK');
|
||||
|
||||
Reference in new issue
Block a user