8000 fix: remove warning (#4949) · ovh/cds@fafd208 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit fafd208

Browse files
authored
fix: remove warning (#4949)
1 parent 53cb881 commit fafd208

File tree

72 files changed

+64
-3288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+64
-3288
lines changed

engine/api/admin.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,6 @@ func (api *API) postMaintenanceHandler() service.Handler {
4040
}
4141
}
4242

43-
func (api *API) adminTruncateWarningsHandler() service.Handler {
44-
return func(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
45-
if _, err := api.mustDB().Exec("delete from warning"); err != nil {
46-
return sdk.WrapError(err, "Unable to truncate warning ")
47-
}
48-
return nil
49-
}
50-
}
51-
5243
func (api *API) getAdminServicesHandler() service.Handler {
5344
return func(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
5445
srvs := []sdk.Service{}

engine/api/api.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import (
4646
"github.com/ovh/cds/engine/api/secret"
4747
"github.com/ovh/cds/engine/api/services"
4848
"github.com/ovh/cds/engine/api/version"
49-
"github.com/ovh/cds/engine/api/warning"
5049
"github.com/ovh/cds/engine/api/worker"
5150
"github.com/ovh/cds/engine/api/workermodel"
5251
"github.com/ovh/cds/engine/api/workflow"
@@ -251,7 +250,6 @@ type API struct {
251250
StartupTime time.Time
252251
Maintenance bool
253252
eventsBroker *eventsBroker
254-
warnChan chan sdk.Event
255253
Cache cache.Store
256254
Metrics struct {
257255
WorkflowRunFailed *stats.Int64Measure
@@ -623,9 +621,6 @@ func (a *API) Serve(ctx context.Context) error {
623621
go event.DequeueEvent(ctx, a.mustDB())
624622
}
625623

626-
a.warnChan = make(chan sdk.Event)
627-
event.Subscribe(a.warnChan)
628-
629624
log.Info(ctx, "Initializing internal routines...")
630625
sdk.GoRoutine(ctx, "maintenance.Subscribe", func(ctx context.Context) {
631626
if err := a.listenMaintenance(ctx); err != nil {
@@ -657,9 +652,6 @@ func (a *API) Serve(ctx context.Context) error {
657652
sdk.GoRoutine(ctx, "workflowtemplate.ComputeAudit", func(ctx context.Context) {
658653
workflowtemplate.ComputeAudit(ctx, a.DBConnectionFactory.GetDBMap)
659654
}, a.PanicDump())
660-
sdk.GoRoutine(ctx, "warning.Start", func(ctx context.Context) {
661-
warning.Start(ctx, a.DBConnectionFactory.GetDBMap, a.warnChan)
662-
}, a.PanicDump())
663655
sdk.GoRoutine(ctx, "auditCleanerRoutine(ctx", func(ctx context.Context) {
664656
auditCleanerRoutine(ctx, a.DBConnectionFactory.GetDBMap)
665657
})

engine/api/api_routes.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ func (api *API) InitRouter() {
7272

7373
// Admin
7474
r.Handle("/admin/maintenance", Scope(sdk.AuthConsumerScopeAdmin), r.POST(api.postMaintenanceHandler, NeedAdmin(true)))
75-
r.Handle("/admin/warning", Scope(sdk.AuthConsumerScopeAdmin), r.DELETE(api.adminTruncateWarningsHandler, NeedAdmin(true)))
7675
r.Handle("/admin/cds/migration", Scope(sdk.AuthConsumerScopeAdmin), r.GET(api.getAdminMigrationsHandler, NeedAdmin(true)))
7776
r.Handle("/admin/cds/migration/{id}/cancel", Scope(sdk.AuthConsumerScopeAdmin), r.POST(api.postAdminMigrationCancelHandler, NeedAdmin(true)))
7877
r.Handle("/admin/cds/migration/{id}/todo", Scope(sdk.AuthConsumerScopeAdmin), r.POST(api.postAdminMigrationTodoHandler, NeedAdmin(true)))
@@ -178,9 +177,6 @@ func (api *API) InitRouter() {
178177
// Export Application
179178
r.Handle("/project/{permProjectKey}/export/application/{applicationName}", Scope(sdk.AuthConsumerScopeProject), r.GET(api.getApplicationExportHandler))
180179

181-
r.Handle("/warning/{permProjectKey}", Scope(sdk.AuthConsumerScopeProject), r.GET(api.getWarningsHandler))
182-
r.Handle("/warning/{permProjectKey}/{hash}", Scope(sdk.AuthConsumerScopeProject), r.PUT(api.putWarningsHandler))
183-
184180
// Application
185181
r.Handle("/project/{permProjectKey}/ascode/application", Scope(sdk.AuthConsumerScopeProject), r.GET(api.getAsCodeApplicationHandler))
186182
r.Handle("/project/{permProjectKey}/application/{applicationName}", Scope(sdk.AuthConsumerScopeProject), r.GET(api.getApplicationHandler), r.PUT(api.updateApplicationHandler), r.DELETE(api.deleteApplicationHandler))

engine/api/warning.go

Lines changed: 0 additions & 61 deletions
This file was deleted.

engine/api/warning/dao.go

Lines changed: 0 additions & 121 deletions
This file was deleted.

engine/api/warning/gorp_model.go

Lines changed: 0 additions & 14 deletions
This file was deleted.

engine/api/warning/warning.go

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0