mirror of
https://github.com/pockethost/pockethost.git
synced 2025-05-30 02:36:40 +00:00
feat(pockethost): kill instance action
This commit is contained in:
parent
5aa29c8c0f
commit
795fcd7ff1
5
.changeset/shaggy-foxes-protect.md
Normal file
5
.changeset/shaggy-foxes-protect.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'pockethost': minor
|
||||||
|
---
|
||||||
|
|
||||||
|
New action: KillInstance
|
@ -137,6 +137,12 @@ onServeAction(async ({ only }) => {
|
|||||||
|
|
||||||
Fired after all plugins have been loaded. This is a good time to perform initialization that may depend upon other plugins.
|
Fired after all plugins have been loaded. This is a good time to perform initialization that may depend upon other plugins.
|
||||||
|
|
||||||
|
#### KillInstance (since 1.6.0)
|
||||||
|
|
||||||
|
```ts
|
||||||
|
await doKillInstanceAction({ instance })
|
||||||
|
```
|
||||||
|
|
||||||
### Core Filters
|
### Core Filters
|
||||||
|
|
||||||
#### ServerSlugs (since 1.4.0)
|
#### ServerSlugs (since 1.4.0)
|
||||||
|
@ -21,6 +21,8 @@ enum CoreActions {
|
|||||||
BeforeInstanceStarted = 'core_before_instance_started',
|
BeforeInstanceStarted = 'core_before_instance_started',
|
||||||
AfterInstanceStarted = 'core_after_instance_started',
|
AfterInstanceStarted = 'core_after_instance_started',
|
||||||
|
|
||||||
|
KillInstance = 'core_kill_instance',
|
||||||
|
|
||||||
BeforeInstanceStopped = 'core_before_instance_stopped',
|
BeforeInstanceStopped = 'core_before_instance_stopped',
|
||||||
AfterInstanceStopped = 'core_after_instance_stopped',
|
AfterInstanceStopped = 'core_after_instance_stopped',
|
||||||
|
|
||||||
@ -140,6 +142,11 @@ export const [doAfterInstanceStartedAction, onAfterInstanceStartedAction] =
|
|||||||
CoreActions.AfterInstanceStarted,
|
CoreActions.AfterInstanceStarted,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
export const [doKillInstanceAction, onKillInstanceAction] =
|
||||||
|
createCustomActionWithContext<{ instance: InstanceFields }>(
|
||||||
|
CoreActions.KillInstance,
|
||||||
|
)
|
||||||
|
|
||||||
export const [doBeforeInstanceStoppedAction, onBeforeInstanceStoppedAction] =
|
export const [doBeforeInstanceStoppedAction, onBeforeInstanceStoppedAction] =
|
||||||
createCustomActionWithContext<{ instance: InstanceFields; url: string }>(
|
createCustomActionWithContext<{ instance: InstanceFields; url: string }>(
|
||||||
CoreActions.BeforeInstanceStopped,
|
CoreActions.BeforeInstanceStopped,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user