mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix starting of lens proxy
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
e49b0f61ce
commit
d173e45177
4 files changed
+72
-54
No files matched your search
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
export type Starter = (signal: AbortSignal) => Promise<void>;
|
||||
|
||||
export interface SingleStartable {
|
||||
start: () => Promise<void>;
|
||||
stop: () => void;
|
||||
}
|
||||
|
||||
export function getSingleStartable(id: string, start: Starter): SingleStartable {
|
||||
const controller = new AbortController();
|
||||
|
||||
return {
|
||||
start: async () => {
|
||||
await start(controller.signal);
|
||||
},
|
||||
stop: () => {
|
||||
controller.abort();
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user