You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/06/26 04:01:26 UTC
[GitHub] [apisix-dashboard] bzp2010 opened a new pull request #1956: refactor: server manager
bzp2010 opened a new pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956
Please answer these questions before submitting a pull request, **or your PR will get closed**.
**Why submit this pull request?**
- [ ] Bugfix
- [ ] New feature provided
- [x] Improve performance
- [ ] Backport patches
**What changes will this PR take into?**
Refactoring the management code of Manager API to help to initialize, start and stop. Reduce redundant code and improve readability.
I created a new `server` module in `internal/core`.
It will help run according to the process of `NewServer()`->`server.init()`->`Start()`->`Stop()`.
It covers the functions of initializing etcd client, initializing store, initializing route and starting HTTP server.
**Checklist:**
- [x] Did you explain what problem does this PR solve? Or what new features have been added?
- [ ] Have you added corresponding test cases?
- [x] Have you modified the corresponding document?
- [x] Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b55762b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...b55762b](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659502738
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
+ return err
+ default:
+ return nil
+ }
+}
+
+func (s *server) Stop() {
+ utils.CloseAll()
+
+ s.shutdownServer(s.server)
+ s.shutdownServer(s.serverSSL)
+}
+
+func (s *server) init() error {
+ log.Info("Initialize Manager API store")
+ err := s.setupStore()
+ if err != nil {
+ return err
+ }
+
+ log.Info("Initialize Manager API server")
+ s.setupHTTPServer()
Review comment:
I think it's good
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e0ce9d8) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `0.10%`.
> The diff coverage is `54.45%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 66.78% -0.11%
==========================================
Files 179 182 +3
Lines 6551 6575 +24
Branches 753 753
==========================================
+ Hits 4382 4391 +9
- Misses 1899 1908 +9
- Partials 270 276 +6
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.57% <54.45%> (-0.05%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `46.76% <47.52%> (-0.16%)` | :arrow_down: |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `63.95% <ø> (-0.07%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `51.78% <51.78%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `78.94% <83.33%> (+19.35%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | `43.63% <0.00%> (-3.64%)` | :arrow_down: |
| [web/src/helpers.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9oZWxwZXJzLnRzeA==) | `68.85% <0.00%> (-3.28%)` | :arrow_down: |
| ... and [2 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...e0ce9d8](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] commented on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] commented on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:construction_worker: Deploy Preview for *apisix-dashboard* processing.
:hammer: Explore the source changes: 5105b37f458d6917d8e1b57da8d1b245839cf3d2
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d6a69157384e0008bb5516](https://app.netlify.com/sites/apisix-dashboard/deploys/60d6a69157384e0008bb5516?utm_source=github&utm_campaign=bot_dl)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (557e532) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...557e532](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b55762b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `3.31%`.
> The diff coverage is `54.45%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 63.57% -3.32%
==========================================
Files 179 60 -119
Lines 6551 3421 -3130
Branches 753 0 -753
==========================================
- Hits 4382 2175 -2207
+ Misses 1899 965 -934
- Partials 270 281 +11
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.75% <54.45%> (+0.12%)` | :arrow_up: |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `51.78% <51.78%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `78.94% <83.33%> (+19.35%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/migrate/conflict.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9jb25mbGljdC5nbw==) | `0.00% <0.00%> (-76.93%)` | :arrow_down: |
| [api/internal/core/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9taWdyYXRlLmdv) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
| [api/internal/core/migrate/dataset.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9kYXRhc2V0Lmdv) | `0.00% <0.00%> (-52.73%)` | :arrow_down: |
| [api/internal/handler/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbWlncmF0ZS9taWdyYXRlLmdv) | `5.55% <0.00%> (-51.86%)` | :arrow_down: |
| ... and [140 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...b55762b](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e0ce9d8) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **increase** coverage by `2.50%`.
> The diff coverage is `54.45%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
+ Coverage 66.89% 69.39% +2.50%
==========================================
Files 179 60 -119
Lines 6551 3421 -3130
Branches 753 0 -753
==========================================
- Hits 4382 2374 -2008
+ Misses 1899 771 -1128
- Partials 270 276 +6
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.57% <54.45%> (-0.05%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `46.76% <47.52%> (-0.16%)` | :arrow_down: |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `51.78% <51.78%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `78.94% <83.33%> (+19.35%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | `43.63% <0.00%> (-3.64%)` | :arrow_down: |
| [web/src/components/Upstream/constant.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbnN0YW50LnRz) | | |
| [web/src/app.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9hcHAudHN4) | | |
| [web/src/pages/User/Login.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Vc2VyL0xvZ2luLnRzeA==) | | |
| ... and [123 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...e0ce9d8](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (367d174) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...367d174](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659285394
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
+ return err
+ default:
+ return nil
+ }
+}
+
+func (s *server) Stop() {
+ utils.CloseAll()
+
+ s.shutdownServer(s.server)
+ s.shutdownServer(s.serverSSL)
+}
+
+func (s *server) init() error {
+ log.Info("Initialize Manager API store")
+ err := s.setupStore()
+ if err != nil {
+ return err
+ }
+
+ log.Info("Initialize Manager API server")
+ s.setupHTTPServer()
Review comment:
emmm, If it's `s.setupServers`, it looks like it's initializing the entire `Manager API server`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659286210
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
Review comment:
Please forgive me for not knowing the relevant content of go runtime. Can you talk more deeply or have related document content?
I search about some related questions, and the solution given is just like what these codes do now.
> https://stackoverflow.com/questions/26090301/run-both-http-and-https-in-same-program/29468115
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eeb8bbc) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...eeb8bbc](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4906cb) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.66%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.23% -14.67%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1405 -2977
+ Misses 1899 1097 -802
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.23% <0.00%> (-0.10%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...a4906cb](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1700f1e) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `3.27%`.
> The diff coverage is `54.25%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 63.62% -3.28%
==========================================
Files 179 60 -119
Lines 6551 3414 -3137
Branches 753 0 -753
==========================================
- Hits 4382 2172 -2210
+ Misses 1899 962 -937
- Partials 270 280 +10
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.75% <54.25%> (+0.12%)` | :arrow_up: |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `50.00% <50.00%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `83.78% <90.90%> (+24.18%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/migrate/conflict.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9jb25mbGljdC5nbw==) | `0.00% <0.00%> (-76.93%)` | :arrow_down: |
| [api/internal/core/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9taWdyYXRlLmdv) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
| [api/internal/core/migrate/dataset.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9kYXRhc2V0Lmdv) | `0.00% <0.00%> (-52.73%)` | :arrow_down: |
| [api/internal/handler/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbWlncmF0ZS9taWdyYXRlLmdv) | `5.55% <0.00%> (-51.86%)` | :arrow_down: |
| ... and [140 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...1700f1e](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (53e21e6) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `3.31%`.
> The diff coverage is `54.45%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 63.57% -3.32%
==========================================
Files 179 60 -119
Lines 6551 3421 -3130
Branches 753 0 -753
==========================================
- Hits 4382 2175 -2207
+ Misses 1899 965 -934
- Partials 270 281 +11
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.75% <54.45%> (+0.12%)` | :arrow_up: |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `51.78% <51.78%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `78.94% <83.33%> (+19.35%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/migrate/conflict.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9jb25mbGljdC5nbw==) | `0.00% <0.00%> (-76.93%)` | :arrow_down: |
| [api/internal/core/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9taWdyYXRlLmdv) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
| [api/internal/core/migrate/dataset.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9kYXRhc2V0Lmdv) | `0.00% <0.00%> (-52.73%)` | :arrow_down: |
| [api/internal/handler/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbWlncmF0ZS9taWdyYXRlLmdv) | `5.55% <0.00%> (-51.86%)` | :arrow_down: |
| ... and [140 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...53e21e6](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659278399
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
+ return err
+ default:
+ return nil
+ }
+}
+
+func (s *server) Stop() {
+ utils.CloseAll()
+
+ s.shutdownServer(s.server)
+ s.shutdownServer(s.serverSSL)
+}
+
+func (s *server) init() error {
+ log.Info("Initialize Manager API store")
+ err := s.setupStore()
+ if err != nil {
+ return err
+ }
+
+ log.Info("Initialize Manager API server")
+ s.setupHTTPServer()
Review comment:
@tokers
In fact, it initializes routes, HTTP(s) server and any other content related to HTTP API. But I don't have a better idea of naming it.
Do you have any suggestions?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:construction_worker: Deploy Preview for *apisix-dashboard* processing.
:hammer: Explore the source changes: a9719c802f5d4d6576db8f6d9ec15cc261d97ee2
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d95f2e1c1e35000880e1c5](https://app.netlify.com/sites/apisix-dashboard/deploys/60d95f2e1c1e35000880e1c5?utm_source=github&utm_campaign=bot_dl)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (140f81c) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
> :exclamation: Current head 140f81c differs from pull request most recent head 74ebcf9. Consider uploading reports for the commit 74ebcf9 to get more accurate results
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...74ebcf9](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (77bb44e) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
> :exclamation: Current head 77bb44e differs from pull request most recent head ddaa74e. Consider uploading reports for the commit ddaa74e to get more accurate results
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...ddaa74e](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9c09eaa) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `3.29%`.
> The diff coverage is `52.17%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 63.59% -3.30%
==========================================
Files 179 60 -119
Lines 6551 3417 -3134
Branches 753 0 -753
==========================================
- Hits 4382 2173 -2209
+ Misses 1899 964 -935
- Partials 270 280 +10
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.74% <52.17%> (+0.11%)` | :arrow_up: |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `51.02% <51.02%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `78.04% <70.00%> (+18.45%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/migrate/conflict.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9jb25mbGljdC5nbw==) | `0.00% <0.00%> (-76.93%)` | :arrow_down: |
| [api/internal/core/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9taWdyYXRlLmdv) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
| [api/internal/core/migrate/dataset.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9kYXRhc2V0Lmdv) | `0.00% <0.00%> (-52.73%)` | :arrow_down: |
| [api/internal/handler/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbWlncmF0ZS9taWdyYXRlLmdv) | `5.55% <0.00%> (-51.86%)` | :arrow_down: |
| ... and [140 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...9c09eaa](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:construction_worker: Deploy Preview for *apisix-dashboard* processing.
:hammer: Explore the source changes: 58c601d6dff398a779cf0d987a458810601a43ea
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d957c9d08e200009203955](https://app.netlify.com/sites/apisix-dashboard/deploys/60d957c9d08e200009203955?utm_source=github&utm_campaign=bot_dl)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:construction_worker: Deploy Preview for *apisix-dashboard* processing.
:hammer: Explore the source changes: 29c721032ce8fe758f07e0828990a1cc418bb504
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d972a3d698d4000770b9ca](https://app.netlify.com/sites/apisix-dashboard/deploys/60d972a3d698d4000770b9ca?utm_source=github&utm_campaign=bot_dl)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (367d174) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `3.42%`.
> The diff coverage is `50.53%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 63.46% -3.43%
==========================================
Files 179 60 -119
Lines 6551 3413 -3138
Branches 753 0 -753
==========================================
- Hits 4382 2166 -2216
+ Misses 1899 969 -930
- Partials 270 278 +8
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.59% <50.53%> (-0.04%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `42.85% <42.85%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `83.78% <90.90%> (+24.18%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/migrate/conflict.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9jb25mbGljdC5nbw==) | `0.00% <0.00%> (-76.93%)` | :arrow_down: |
| [api/internal/core/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9taWdyYXRlLmdv) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
| [api/internal/core/migrate/dataset.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9kYXRhc2V0Lmdv) | `0.00% <0.00%> (-52.73%)` | :arrow_down: |
| [api/internal/handler/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbWlncmF0ZS9taWdyYXRlLmdv) | `5.55% <0.00%> (-51.86%)` | :arrow_down: |
| ... and [140 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...367d174](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659456890
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
Review comment:
Yes, I understand the problems here.
Therefore, I try to change the `default case` to a 5 seconds timer. The listen operation of most devices should be completed within 5 seconds, so the current select will block start for 5 seconds, but it will not affect the HTTP server in goroutine. If the error of `Listen` does not return within 5 seconds, it is considered that no error has occurred and the timer returns `nil` error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:heavy_check_mark: Deploy Preview for *apisix-dashboard* ready!
:hammer: Explore the source changes: e0ce9d8a3b26d0cae24dcb382f4a5810389c675d
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d7fbc58af4b8000855f221](https://app.netlify.com/sites/apisix-dashboard/deploys/60d7fbc58af4b8000855f221?utm_source=github&utm_campaign=bot_dl)
:sunglasses: Browse the preview: [https://deploy-preview-1956--apisix-dashboard.netlify.app](https://deploy-preview-1956--apisix-dashboard.netlify.app?utm_source=github&utm_campaign=bot_dp)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eeb8bbc) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `3.34%`.
> The diff coverage is `50.51%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 63.54% -3.35%
==========================================
Files 179 60 -119
Lines 6551 3421 -3130
Branches 753 0 -753
==========================================
- Hits 4382 2174 -2208
+ Misses 1899 967 -932
- Partials 270 280 +10
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.72% <50.51%> (+0.09%)` | :arrow_up: |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `49.05% <49.05%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `78.04% <63.63%> (+18.45%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/migrate/conflict.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9jb25mbGljdC5nbw==) | `0.00% <0.00%> (-76.93%)` | :arrow_down: |
| [api/internal/core/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9taWdyYXRlLmdv) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
| [api/internal/core/migrate/dataset.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9kYXRhc2V0Lmdv) | `0.00% <0.00%> (-52.73%)` | :arrow_down: |
| [api/internal/handler/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbWlncmF0ZS9taWdyYXRlLmdv) | `5.55% <0.00%> (-51.86%)` | :arrow_down: |
| ... and [140 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...eeb8bbc](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659278399
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
+ return err
+ default:
+ return nil
+ }
+}
+
+func (s *server) Stop() {
+ utils.CloseAll()
+
+ s.shutdownServer(s.server)
+ s.shutdownServer(s.serverSSL)
+}
+
+func (s *server) init() error {
+ log.Info("Initialize Manager API store")
+ err := s.setupStore()
+ if err != nil {
+ return err
+ }
+
+ log.Info("Initialize Manager API server")
+ s.setupHTTPServer()
Review comment:
In fact, it initializes routes, HTTP(s) server and any other content related to HTTP API. I don't have a better idea of naming it.
Do you have any suggestions?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659285394
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
+ return err
+ default:
+ return nil
+ }
+}
+
+func (s *server) Stop() {
+ utils.CloseAll()
+
+ s.shutdownServer(s.server)
+ s.shutdownServer(s.serverSSL)
+}
+
+func (s *server) init() error {
+ log.Info("Initialize Manager API store")
+ err := s.setupStore()
+ if err != nil {
+ return err
+ }
+
+ log.Info("Initialize Manager API server")
+ s.setupHTTPServer()
Review comment:
emmm, If it's `s.setupServers`, it looks like it's initializing the entire `Manager API server`.
> The `server` module is used to process the complete life cycle of Manager API, from initialization, connection to storage, starting server and shutting down the server.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (53e21e6) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...53e21e6](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (53e21e6) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **increase** coverage by `2.56%`.
> The diff coverage is `54.45%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
+ Coverage 66.89% 69.45% +2.56%
==========================================
Files 179 60 -119
Lines 6551 3421 -3130
Branches 753 0 -753
==========================================
- Hits 4382 2376 -2006
+ Misses 1899 768 -1131
- Partials 270 277 +7
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.75% <54.45%> (+0.12%)` | :arrow_up: |
| backend-e2e-test-ginkgo | `46.85% <50.49%> (-0.07%)` | :arrow_down: |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `51.78% <51.78%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `78.94% <83.33%> (+19.35%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `88.30% <0.00%> (-1.17%)` | :arrow_down: |
| [...mponents/PluginFlow/components/FlowGraph/shapes.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbkZsb3cvY29tcG9uZW50cy9GbG93R3JhcGgvc2hhcGVzLnRz) | | |
| [...mponents/Upstream/components/active-check/Port.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL1BvcnQudHN4) | | |
| [...ents/Upstream/components/active-check/HttpPath.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL0h0dHBQYXRoLnRzeA==) | | |
| ... and [123 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...53e21e6](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5509d1d) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `2.87%`.
> The diff coverage is `n/a`.
> :exclamation: Current head 5509d1d differs from pull request most recent head 367d174. Consider uploading reports for the commit 367d174 to get more accurate results
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 64.01% -2.88%
==========================================
Files 179 122 -57
Lines 6551 3154 -3397
Branches 753 753
==========================================
- Hits 4382 2019 -2363
+ Misses 1899 1135 -764
+ Partials 270 0 -270
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `?` | |
| frontend-e2e-test | `64.01% <ø> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=) | | |
| [api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=) | | |
| [api/internal/filter/logging.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9sb2dnaW5nLmdv) | | |
| [api/internal/core/migrate/conflict.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9jb25mbGljdC5nbw==) | | |
| [.../internal/handler/authentication/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvYXV0aGVudGljYXRpb24vYXV0aGVudGljYXRpb24uZ28=) | | |
| [api/internal/core/store/validate\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGVfbW9jay5nbw==) | | |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | | |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | | |
| [api/cmd/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9zZXJ2aWNlLmdv) | | |
| [api/internal/handler/data\_loader/route\_export.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfZXhwb3J0Lmdv) | | |
| ... and [44 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...367d174](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659278399
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
+ return err
+ default:
+ return nil
+ }
+}
+
+func (s *server) Stop() {
+ utils.CloseAll()
+
+ s.shutdownServer(s.server)
+ s.shutdownServer(s.serverSSL)
+}
+
+func (s *server) init() error {
+ log.Info("Initialize Manager API store")
+ err := s.setupStore()
+ if err != nil {
+ return err
+ }
+
+ log.Info("Initialize Manager API server")
+ s.setupHTTPServer()
Review comment:
@tokers
In fact, it initializes routes, HTTP(s) server and any other content related to HTTP API. I don't have a better idea of naming it.
Do you have any suggestions?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9c09eaa) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...9c09eaa](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:heavy_check_mark: Deploy Preview for *apisix-dashboard* ready!
:hammer: Explore the source changes: b541ed56c6dfd8c08608c02ffe11db21257b436d
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d95b0e1e2b23000748045b](https://app.netlify.com/sites/apisix-dashboard/deploys/60d95b0e1e2b23000748045b?utm_source=github&utm_campaign=bot_dl)
:sunglasses: Browse the preview: [https://deploy-preview-1956--apisix-dashboard.netlify.app](https://deploy-preview-1956--apisix-dashboard.netlify.app?utm_source=github&utm_campaign=bot_dp)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter commented on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a30b77a) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
> :exclamation: Current head a30b77a differs from pull request most recent head 5105b37. Consider uploading reports for the commit 5105b37 to get more accurate results
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...5105b37](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659456890
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
Review comment:
Yes, I understand the problems here.
Therefore, I try to change the `default case` to a 3 seconds timer. The listen operation of most devices should be completed within 3 seconds, so the current select will block start for 3 seconds, but it will not affect the HTTP server in goroutine. If the error of `Listen` does not return within 3 seconds, it is considered that no error has occurred and the timer returns `nil` error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:heavy_check_mark: Deploy Preview for *apisix-dashboard* ready!
:hammer: Explore the source changes: 29c721032ce8fe758f07e0828990a1cc418bb504
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d972a3d698d4000770b9ca](https://app.netlify.com/sites/apisix-dashboard/deploys/60d972a3d698d4000770b9ca?utm_source=github&utm_campaign=bot_dl)
:sunglasses: Browse the preview: [https://deploy-preview-1956--apisix-dashboard.netlify.app](https://deploy-preview-1956--apisix-dashboard.netlify.app?utm_source=github&utm_campaign=bot_dp)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-871090458
Hi, @tokers
If you have free time, can you review it? I have fixed the previous problems.
Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659278937
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
+ return err
+ default:
+ return nil
+ }
+}
+
+func (s *server) Stop() {
+ utils.CloseAll()
+
+ s.shutdownServer(s.server)
+ s.shutdownServer(s.serverSSL)
+}
+
+func (s *server) init() error {
+ log.Info("Initialize Manager API store")
+ err := s.setupStore()
+ if err != nil {
+ return err
+ }
+
+ log.Info("Initialize Manager API server")
+ s.setupHTTPServer()
Review comment:
Then the name is confusing, what about just `s.setupServers`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4906cb) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `3.30%`.
> The diff coverage is `48.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 63.58% -3.31%
==========================================
Files 179 182 +3
Lines 6551 6574 +23
Branches 753 753
==========================================
- Hits 4382 4180 -202
- Misses 1899 2117 +218
- Partials 270 277 +7
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.44% <48.00%> (-0.19%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.23% <0.00%> (-0.10%)` | :arrow_down: |
| frontend-e2e-test | `63.95% <ø> (-0.07%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `40.00% <40.00%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `78.94% <83.33%> (+19.35%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/migrate/conflict.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9jb25mbGljdC5nbw==) | `0.00% <0.00%> (-76.93%)` | :arrow_down: |
| [api/internal/core/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9taWdyYXRlLmdv) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
| [api/internal/core/migrate/dataset.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9kYXRhc2V0Lmdv) | `0.00% <0.00%> (-52.73%)` | :arrow_down: |
| [api/internal/handler/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbWlncmF0ZS9taWdyYXRlLmdv) | `5.55% <0.00%> (-51.86%)` | :arrow_down: |
| ... and [21 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...a4906cb](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (53e21e6) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `0.04%`.
> The diff coverage is `54.45%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 66.84% -0.05%
==========================================
Files 179 182 +3
Lines 6551 6575 +24
Branches 753 753
==========================================
+ Hits 4382 4395 +13
- Misses 1899 1903 +4
- Partials 270 277 +7
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.75% <54.45%> (+0.12%)` | :arrow_up: |
| backend-e2e-test-ginkgo | `46.85% <50.49%> (-0.07%)` | :arrow_down: |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `64.01% <ø> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `51.78% <51.78%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `78.94% <83.33%> (+19.35%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `88.30% <0.00%> (-1.17%)` | :arrow_down: |
| ... and [1 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...53e21e6](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6c4e365) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.66%`.
> The diff coverage is `0.00%`.
> :exclamation: Current head 6c4e365 differs from pull request most recent head a4906cb. Consider uploading reports for the commit a4906cb to get more accurate results
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.23% -14.67%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1405 -2977
+ Misses 1899 1097 -802
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.23% <0.00%> (-0.10%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [161 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...a4906cb](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (367d174) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **increase** coverage by `2.69%`.
> The diff coverage is `54.83%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
+ Coverage 66.89% 69.58% +2.69%
==========================================
Files 179 60 -119
Lines 6551 3413 -3138
Branches 753 0 -753
==========================================
- Hits 4382 2375 -2007
+ Misses 1899 763 -1136
- Partials 270 275 +5
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.59% <50.53%> (-0.04%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `47.17% <54.83%> (+0.24%)` | :arrow_up: |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `51.02% <51.02%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `83.78% <90.90%> (+24.18%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [...pages/SSL/components/CertificateUploader/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9TU0wvY29tcG9uZW50cy9DZXJ0aWZpY2F0ZVVwbG9hZGVyL2luZGV4LnRzeA==) | | |
| [web/src/components/Plugin/UI/limit-conn.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9saW1pdC1jb25uLnRzeA==) | | |
| [web/src/components/LabelsfDrawer/LabelsDrawer.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL0xhYmVsc2ZEcmF3ZXIvTGFiZWxzRHJhd2VyLnRzeA==) | | |
| [web/src/pages/Route/components/Step3/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAzL2luZGV4LnRzeA==) | | |
| ... and [122 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...367d174](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659286210
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
Review comment:
@tokers
Please forgive me for not knowing the relevant content of go runtime. Can you talk more deeply or have related document content?
I search about some related questions, and the solution given is just like what these codes do now.
> https://stackoverflow.com/questions/26090301/run-both-http-and-https-in-same-program/29468115
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b55762b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **increase** coverage by `2.56%`.
> The diff coverage is `54.45%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
+ Coverage 66.89% 69.45% +2.56%
==========================================
Files 179 60 -119
Lines 6551 3421 -3130
Branches 753 0 -753
==========================================
- Hits 4382 2376 -2006
+ Misses 1899 768 -1131
- Partials 270 277 +7
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.75% <54.45%> (+0.12%)` | :arrow_up: |
| backend-e2e-test-ginkgo | `46.76% <47.52%> (-0.16%)` | :arrow_down: |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `51.78% <51.78%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `78.94% <83.33%> (+19.35%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `88.30% <0.00%> (-1.17%)` | :arrow_down: |
| [web/src/services/user.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9zZXJ2aWNlcy91c2VyLnRz) | | |
| [.../components/passive-check/Healthy/HttpStatuses.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvcGFzc2l2ZS1jaGVjay9IZWFsdGh5L0h0dHBTdGF0dXNlcy50c3g=) | | |
| [web/src/pages/SSL/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9TU0wvTGlzdC50c3g=) | | |
| ... and [123 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...b55762b](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659410451
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
+ return err
+ default:
+ return nil
+ }
+}
+
+func (s *server) Stop() {
+ utils.CloseAll()
+
+ s.shutdownServer(s.server)
+ s.shutdownServer(s.serverSSL)
+}
+
+func (s *server) init() error {
+ log.Info("Initialize Manager API store")
+ err := s.setupStore()
+ if err != nil {
+ return err
+ }
+
+ log.Info("Initialize Manager API server")
+ s.setupHTTPServer()
Review comment:
Or set up API.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b541ed5) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.66%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.23% -14.67%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1405 -2977
+ Misses 1899 1097 -802
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.23% <0.00%> (-0.10%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...b541ed5](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7853a70) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...7853a70](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7853a70) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `1.22%`.
> The diff coverage is `50.52%`.
> :exclamation: Current head 7853a70 differs from pull request most recent head 557e532. Consider uploading reports for the commit 557e532 to get more accurate results
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 65.66% -1.23%
==========================================
Files 179 60 -119
Lines 6551 3419 -3132
Branches 753 0 -753
==========================================
- Hits 4382 2245 -2137
+ Misses 1899 898 -1001
- Partials 270 276 +6
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `47.08% <50.52%> (+0.16%)` | :arrow_up: |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `50.00% <50.00%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `76.19% <58.33%> (+16.59%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `56.25% <0.00%> (-43.75%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `30.24% <0.00%> (-34.68%)` | :arrow_down: |
| [api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=) | `66.12% <0.00%> (-17.75%)` | :arrow_down: |
| [api/internal/utils/utils.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3V0aWxzLmdv) | `54.11% <0.00%> (-11.77%)` | :arrow_down: |
| ... and [132 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...557e532](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e0ce9d8) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...e0ce9d8](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:heavy_check_mark: Deploy Preview for *apisix-dashboard* ready!
:hammer: Explore the source changes: 367d174edab70cc9ebdc4f6910e14a4783391f56
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d961207886c70007ccdebb](https://app.netlify.com/sites/apisix-dashboard/deploys/60d961207886c70007ccdebb?utm_source=github&utm_campaign=bot_dl)
:sunglasses: Browse the preview: [https://deploy-preview-1956--apisix-dashboard.netlify.app](https://deploy-preview-1956--apisix-dashboard.netlify.app?utm_source=github&utm_campaign=bot_dp)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] starsz commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659409636
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
Review comment:
Yes, here we can't get err absolutely even if the error occurs.
Maybe we can return a channel in this function.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1700f1e) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...1700f1e](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:heavy_check_mark: Deploy Preview for *apisix-dashboard* ready!
:hammer: Explore the source changes: 53e21e60af83705854ce2473fa9f26a5a88a8895
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d6ac111ff18100070c814d](https://app.netlify.com/sites/apisix-dashboard/deploys/60d6ac111ff18100070c814d?utm_source=github&utm_campaign=bot_dl)
:sunglasses: Browse the preview: [https://deploy-preview-1956--apisix-dashboard.netlify.app](https://deploy-preview-1956--apisix-dashboard.netlify.app?utm_source=github&utm_campaign=bot_dp)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eeb8bbc) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `3.45%`.
> The diff coverage is `50.51%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 63.43% -3.46%
==========================================
Files 179 60 -119
Lines 6551 3421 -3130
Branches 753 0 -753
==========================================
- Hits 4382 2170 -2212
+ Misses 1899 971 -928
- Partials 270 280 +10
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.60% <50.51%> (-0.03%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `49.05% <49.05%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `78.04% <63.63%> (+18.45%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/migrate/conflict.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9jb25mbGljdC5nbw==) | `0.00% <0.00%> (-76.93%)` | :arrow_down: |
| [api/internal/core/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9taWdyYXRlLmdv) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
| [api/internal/core/migrate/dataset.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9kYXRhc2V0Lmdv) | `0.00% <0.00%> (-52.73%)` | :arrow_down: |
| [api/internal/handler/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbWlncmF0ZS9taWdyYXRlLmdv) | `5.55% <0.00%> (-51.86%)` | :arrow_down: |
| ... and [141 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...eeb8bbc](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:heavy_check_mark: Deploy Preview for *apisix-dashboard* ready!
:hammer: Explore the source changes: 74ebcf9df72c061ebe94b173b9a3ba380a8a3445
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d9673a4d46b900078341b2](https://app.netlify.com/sites/apisix-dashboard/deploys/60d9673a4d46b900078341b2?utm_source=github&utm_campaign=bot_dl)
:sunglasses: Browse the preview: [https://deploy-preview-1956--apisix-dashboard.netlify.app](https://deploy-preview-1956--apisix-dashboard.netlify.app?utm_source=github&utm_campaign=bot_dp)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659306776
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
Review comment:
Just like I said:
> These two goroutines might not get the change to run when the select statement is run.
And since the `select` statement is non-block, the select run happens before the two servers try to send error message (if errors really occurred).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:construction_worker: Deploy Preview for *apisix-dashboard* processing.
:hammer: Explore the source changes: e0ce9d8a3b26d0cae24dcb382f4a5810389c675d
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d7fbc58af4b8000855f221](https://app.netlify.com/sites/apisix-dashboard/deploys/60d7fbc58af4b8000855f221?utm_source=github&utm_campaign=bot_dl)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659545530
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
Review comment:
**Update:** Yes, I have modified it in this way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:heavy_check_mark: Deploy Preview for *apisix-dashboard* ready!
:hammer: Explore the source changes: eeb8bbcc295e0ac0c76b35146d463aa6bf9eacba
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d975c1ff28bc0007fd8b5a](https://app.netlify.com/sites/apisix-dashboard/deploys/60d975c1ff28bc0007fd8b5a?utm_source=github&utm_campaign=bot_dl)
:sunglasses: Browse the preview: [https://deploy-preview-1956--apisix-dashboard.netlify.app](https://deploy-preview-1956--apisix-dashboard.netlify.app?utm_source=github&utm_campaign=bot_dp)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a7fdf05) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `2.94%`.
> The diff coverage is `n/a`.
> :exclamation: Current head a7fdf05 differs from pull request most recent head 557e532. Consider uploading reports for the commit 557e532 to get more accurate results
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 63.95% -2.95%
==========================================
Files 179 122 -57
Lines 6551 3154 -3397
Branches 753 753
==========================================
- Hits 4382 2017 -2365
+ Misses 1899 1137 -762
+ Partials 270 0 -270
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `?` | |
| frontend-e2e-test | `63.95% <ø> (-0.07%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [web/src/helpers.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9oZWxwZXJzLnRzeA==) | `68.85% <0.00%> (-3.28%)` | :arrow_down: |
| [api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==) | | |
| [api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==) | | |
| [api/internal/utils/json\_patch.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2pzb25fcGF0Y2guZ28=) | | |
| [api/internal/handler/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbWlncmF0ZS9taWdyYXRlLmdv) | | |
| [api/internal/handler/schema/plugin.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3BsdWdpbi5nbw==) | | |
| [api/internal/utils/closer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2Nsb3Nlci5nbw==) | | |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | | |
| [api/internal/log/zap.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2xvZy96YXAuZ28=) | | |
| [api/cmd/status.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9zdGF0dXMuZ28=) | | |
| ... and [45 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...557e532](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:heavy_check_mark: Deploy Preview for *apisix-dashboard* ready!
:hammer: Explore the source changes: 557e53242c1037dff318b00c792de65b4eb18b8d
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d96cc650ad090007e80291](https://app.netlify.com/sites/apisix-dashboard/deploys/60d96cc650ad090007e80291?utm_source=github&utm_campaign=bot_dl)
:sunglasses: Browse the preview: [https://deploy-preview-1956--apisix-dashboard.netlify.app](https://deploy-preview-1956--apisix-dashboard.netlify.app?utm_source=github&utm_campaign=bot_dp)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:construction_worker: Deploy Preview for *apisix-dashboard* processing.
:hammer: Explore the source changes: 1700f1e9463952397ded36a7f315ff7623e8ffd3
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d969df4d46b90007834931](https://app.netlify.com/sites/apisix-dashboard/deploys/60d969df4d46b90007834931?utm_source=github&utm_campaign=bot_dl)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b541ed5) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **increase** coverage by `2.53%`.
> The diff coverage is `51.61%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
+ Coverage 66.89% 69.42% +2.53%
==========================================
Files 179 60 -119
Lines 6551 3418 -3133
Branches 753 0 -753
==========================================
- Hits 4382 2373 -2009
+ Misses 1899 769 -1130
- Partials 270 276 +6
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.47% <46.23%> (-0.16%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `47.13% <51.61%> (+0.20%)` | :arrow_up: |
| backend-unit-test | `52.23% <0.00%> (-0.10%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `51.02% <51.02%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `76.19% <63.63%> (+16.59%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `87.71% <0.00%> (-1.76%)` | :arrow_down: |
| [web/src/pages/Route/transform.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS90cmFuc2Zvcm0udHM=) | | |
| [web/src/pages/Upstream/Create.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9VcHN0cmVhbS9DcmVhdGUudHN4) | | |
| [...b/src/components/Plugin/UI/referer-restriction.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9yZWZlcmVyLXJlc3RyaWN0aW9uLnRzeA==) | | |
| ... and [123 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...b541ed5](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:construction_worker: Deploy Preview for *apisix-dashboard* processing.
:hammer: Explore the source changes: eeb8bbcc295e0ac0c76b35146d463aa6bf9eacba
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d975c1ff28bc0007fd8b5a](https://app.netlify.com/sites/apisix-dashboard/deploys/60d975c1ff28bc0007fd8b5a?utm_source=github&utm_campaign=bot_dl)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:construction_worker: Deploy Preview for *apisix-dashboard* processing.
:hammer: Explore the source changes: 74ebcf9df72c061ebe94b173b9a3ba380a8a3445
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d9673a4d46b900078341b2](https://app.netlify.com/sites/apisix-dashboard/deploys/60d9673a4d46b900078341b2?utm_source=github&utm_campaign=bot_dl)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a9719c8) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...a9719c8](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e4a8d8) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
> :exclamation: Current head 7e4a8d8 differs from pull request most recent head 58c601d. Consider uploading reports for the commit 58c601d to get more accurate results
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...58c601d](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659456890
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
Review comment:
Yes, I understand the problems here.
~~Therefore, I try to change the `default case` to a 3 seconds timer. The listen operation of most devices should be completed within 3 seconds, so the current select will block start for 3 seconds, but it will not affect the HTTP server in goroutine. If the error of `Listen` does not return within 3 seconds, it is considered that no error has occurred and the timer returns `nil` error.~~
I will try to return a channel.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:construction_worker: Deploy Preview for *apisix-dashboard* processing.
:hammer: Explore the source changes: 6c4e36555c28abf02026116f8e261a84c95c9690
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d94b683f653e0008427c7d](https://app.netlify.com/sites/apisix-dashboard/deploys/60d94b683f653e0008427c7d?utm_source=github&utm_campaign=bot_dl)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659277256
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
+ return err
+ default:
+ return nil
+ }
+}
+
+func (s *server) Stop() {
+ utils.CloseAll()
+
+ s.shutdownServer(s.server)
+ s.shutdownServer(s.serverSSL)
+}
+
+func (s *server) init() error {
+ log.Info("Initialize Manager API store")
+ err := s.setupStore()
+ if err != nil {
+ return err
+ }
+
+ log.Info("Initialize Manager API server")
+ s.setupHTTPServer()
Review comment:
Only setup the HTTP server is enough?
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
Review comment:
Frankly, the way to detect whether these servers were started is not reliable, as it depends on the behavior the go runtime, like the scheduler. These two goroutines might not get the change to run when the `select` statement is run.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f1e52a2) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.66%`.
> The diff coverage is `0.00%`.
> :exclamation: Current head f1e52a2 differs from pull request most recent head e08ad67. Consider uploading reports for the commit e08ad67 to get more accurate results
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.23% -14.67%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1405 -2977
+ Misses 1899 1097 -802
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.23% <0.00%> (-0.10%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...e08ad67](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a4906cb) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `3.64%`.
> The diff coverage is `48.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 63.24% -3.65%
==========================================
Files 179 60 -119
Lines 6551 3420 -3131
Branches 753 0 -753
==========================================
- Hits 4382 2163 -2219
+ Misses 1899 980 -919
- Partials 270 277 +7
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.44% <48.00%> (-0.19%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.23% <0.00%> (-0.10%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `40.00% <40.00%> (ø)` | |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `78.94% <83.33%> (+19.35%)` | :arrow_up: |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/migrate/conflict.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9jb25mbGljdC5nbw==) | `0.00% <0.00%> (-76.93%)` | :arrow_down: |
| [api/internal/core/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9taWdyYXRlLmdv) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
| [api/internal/core/migrate/dataset.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9kYXRhc2V0Lmdv) | `0.00% <0.00%> (-52.73%)` | :arrow_down: |
| [api/internal/handler/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbWlncmF0ZS9taWdyYXRlLmdv) | `5.55% <0.00%> (-51.86%)` | :arrow_down: |
| ... and [142 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...a4906cb](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers merged pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
tokers merged pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c2a305b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `3.79%`.
> The diff coverage is `41.66%`.
> :exclamation: Current head c2a305b differs from pull request most recent head 29c7210. Consider uploading reports for the commit 29c7210 to get more accurate results
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
==========================================
- Coverage 66.89% 63.09% -3.80%
==========================================
Files 179 60 -119
Lines 6551 3420 -3131
Branches 753 0 -753
==========================================
- Hits 4382 2158 -2224
+ Misses 1899 986 -913
- Partials 270 276 +6
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `44.26% <41.66%> (-0.36%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
| [api/internal/core/server/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3N0b3JlLmdv) | `14.28% <14.28%> (ø)` | |
| [api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==) | `35.84% <35.84%> (ø)` | |
| [api/cmd/root.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC9yb290Lmdv) | `67.50% <50.00%> (+7.90%)` | :arrow_up: |
| [api/internal/core/server/http.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL2h0dHAuZ28=) | `54.54% <54.54%> (ø)` | |
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `100.00% <100.00%> (ø)` | |
| [api/internal/core/migrate/conflict.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9jb25mbGljdC5nbw==) | `0.00% <0.00%> (-76.93%)` | :arrow_down: |
| [api/internal/core/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9taWdyYXRlLmdv) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
| [api/internal/core/migrate/dataset.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9kYXRhc2V0Lmdv) | `0.00% <0.00%> (-52.73%)` | :arrow_down: |
| [api/internal/handler/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbWlncmF0ZS9taWdyYXRlLmdv) | `5.55% <0.00%> (-51.86%)` | :arrow_down: |
| ... and [142 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...29c7210](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#discussion_r659456890
##########
File path: api/internal/core/server/server.go
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package server
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/log"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+// server is the manager of Manager API, which is responsible for managing the life cycle of Manager API, including initialization, start, stop and so on
+type server struct {
+ server *http.Server
+ serverSSL *http.Server
+ options *Options
+}
+
+type Options struct {
+ ForceStart bool // force start new instance
+}
+
+// NewServer Create a server manager
+func NewServer(options *Options) (*server, error) {
+ return &server{options: options}, nil
+}
+
+func (s *server) Start() error {
+ // initialize server
+ err := s.init()
+ if err != nil {
+ return err
+ }
+
+ // write daemon pid file
+ err = s.writePID()
+ if err != nil {
+ return err
+ }
+
+ // print server info to stdout
+ s.printInfo()
+
+ // For internal error handling across multiple goroutines.
+ errSig := make(chan error, 1)
+
+ // start HTTP server
+ log.Infof("The Manager API is listening on %s", s.server.Addr)
+ go func() {
+ if err := s.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serv fail: %s", err)
+ errSig <- err
+ }
+ }()
+
+ // start HTTPs server
+ if conf.SSLCert != "" && conf.SSLKey != "" {
+ go func() {
+ err := s.serverSSL.ListenAndServeTLS(conf.SSLCert, conf.SSLKey)
+ if err != nil && err != http.ErrServerClosed {
+ log.Errorf("listen and serve for HTTPS failed: %s", err)
+ errSig <- err
+ }
+ }()
+ }
+
+ // handle HTTP(s) server error
+ select {
+ case err := <-errSig:
Review comment:
Yes, I understand the problems here.
~~Therefore, I try to change the `default case` to a 3 seconds timer. The listen operation of most devices should be completed within 3 seconds, so the current select will block start for 3 seconds, but it will not affect the HTTP server in goroutine. If the error of `Listen` does not return within 3 seconds, it is considered that no error has occurred and the timer returns `nil` error.~~
I will try to return a channel. Blocking for a few seconds can cause unpredictable problems.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c2a305b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
> :exclamation: Current head c2a305b differs from pull request most recent head 29c7210. Consider uploading reports for the commit 29c7210 to get more accurate results
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...29c7210](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942418
:heavy_check_mark: Deploy Preview for *apisix-dashboard* ready!
:hammer: Explore the source changes: a4906cbb33559f2021f9c26b1d2eb685fb31a898
:mag: Inspect the deploy log: [https://app.netlify.com/sites/apisix-dashboard/deploys/60d94bc3cfd43300077d02f6](https://app.netlify.com/sites/apisix-dashboard/deploys/60d94bc3cfd43300077d02f6?utm_source=github&utm_campaign=bot_dl)
:sunglasses: Browse the preview: [https://deploy-preview-1956--apisix-dashboard.netlify.app](https://deploy-preview-1956--apisix-dashboard.netlify.app?utm_source=github&utm_campaign=bot_dp)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #1956: refactor: server manager
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1956:
URL: https://github.com/apache/apisix-dashboard/pull/1956#issuecomment-868942577
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1956](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (18a2c2b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4612d02a9c8e50abf13836e4f66ea56e1ab2e145?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4612d02) will **decrease** coverage by `14.62%`.
> The diff coverage is `0.00%`.
> :exclamation: Current head 18a2c2b differs from pull request most recent head 7853a70. Consider uploading reports for the commit 7853a70 to get more accurate results
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1956 +/- ##
===========================================
- Coverage 66.89% 52.26% -14.63%
===========================================
Files 179 38 -141
Lines 6551 2690 -3861
Branches 753 0 -753
===========================================
- Hits 4382 1406 -2976
+ Misses 1899 1096 -803
+ Partials 270 188 -82
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `52.26% <0.00%> (-0.06%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (-36.85%)` | :arrow_down: |
| ... and [162 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1956/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4612d02...7853a70](https://codecov.io/gh/apache/apisix-dashboard/pull/1956?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org