Skip to content

Commit 73b29d7

Browse files
authored
fix: refresh is incorrect in v1.17 (#1360)
* fix: refresh is incorrect in v1.17 * add tests * add tests * address comments * address comments * fix tests
1 parent a059e1b commit 73b29d7

File tree

9 files changed

+1386
-1405
lines changed

9 files changed

+1386
-1405
lines changed

contracts/foundation/application.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,11 @@ type AboutItem struct {
4747
type Application interface {
4848
// About add information to the application's about command.
4949
About(section string, items []AboutItem)
50-
// AddServiceProviders manually sets the list of configured providers.
51-
AddServiceProviders(providers []ServiceProvider)
5250
// Boot register and bootstrap configured service providers.
5351
// It can be deprecated in the future given the With* functions are implemented.
5452
Boot()
55-
// BootServiceProviders boots registered service providers.
56-
BootServiceProviders()
53+
// Build creates a new application instance after configuring.
54+
Build() Application
5755
// Commands register the given commands with the console application.
5856
Commands([]console.Command)
5957
// Context gets the application context.
@@ -67,22 +65,22 @@ type Application interface {
6765
Json() Json
6866
// Publishes register the given paths to be published by the "vendor:publish" command.
6967
Publishes(packageName string, paths map[string]string, groups ...string)
70-
// Refresh all modules after changing config, will call the Boot method simultaneously.
68+
// Refresh reboots facades after changing config, if you want to restart the runners as well, please use the Restart method.
7169
Refresh()
72-
// RegisterServiceProviders registers configured service providers.
73-
RegisterServiceProviders()
74-
// Start starts modules.
75-
Start(runners ...Runner) Application
70+
// Restart restarts the application.
71+
Restart() error
72+
// SetBuilder sets the application builder.
73+
SetBuilder(builder ApplicationBuilder) Application
7674
// SetJson set the JSON implementation.
7775
SetJson(json Json)
7876
// SetLocale set the current application locale.
7977
SetLocale(ctx context.Context, locale string) context.Context
8078
// Shutdown the application and all its runners.
81-
Shutdown()
79+
Shutdown() error
80+
// Start starts modules.
81+
Start()
8282
// Version gets the version number of the application.
8383
Version() string
84-
// Wait for all modules to shutdown.
85-
Wait()
8684

8785
// Paths
8886

contracts/foundation/application_builder.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import (
1717
type ApplicationBuilder interface {
1818
// Create a new application instance after configuring.
1919
Create() Application
20-
// Start starts modules, Wait should be called after to wait for all modules to shutdown.
21-
Start() Application
2220
// WithCallback sets a callback function to be called during application creation.
2321
WithCallback(func()) ApplicationBuilder
2422
// WithCommands sets the application's commands.

0 commit comments

Comments
 (0)