-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove olympus storage implementation and proxy worker #513
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package actions | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/gobuffalo/buffalo" | ||
|
@@ -10,30 +9,15 @@ import ( | |
"github.com/gobuffalo/buffalo/middleware/i18n" | ||
"github.com/gobuffalo/buffalo/middleware/ssl" | ||
"github.com/gobuffalo/buffalo/render" | ||
"github.com/gobuffalo/buffalo/worker" | ||
"github.com/gobuffalo/gocraft-work-adapter" | ||
"github.com/gobuffalo/packr" | ||
"github.com/gocraft/work" | ||
"github.com/gomods/athens/pkg/config/env" | ||
"github.com/gomods/athens/pkg/log" | ||
mw "github.com/gomods/athens/pkg/middleware" | ||
"github.com/gomods/athens/pkg/module" | ||
"github.com/gomods/athens/pkg/storage" | ||
"github.com/gomodule/redigo/redis" | ||
"github.com/rs/cors" | ||
"github.com/unrolled/secure" | ||
) | ||
|
||
const ( | ||
// FetcherWorkerName is the name of the worker fetching sources from experienced cache misses | ||
FetcherWorkerName = "olympusfetcher" | ||
// ReporterWorkerName is the name of the worker reporting cache misses | ||
ReporterWorkerName = "olympusreporter" | ||
workerQueue = "default" | ||
workerModuleKey = "module" | ||
workerVersionKey = "version" | ||
) | ||
|
||
// ENV is used to help switch settings based on where the | ||
// application is being run. Default is "development". | ||
var ENV = env.GoEnvironmentWithDefault("development") | ||
|
@@ -60,7 +44,6 @@ func init() { | |
// should be defined. This is the nerve center of your | ||
// application. | ||
func App() (*buffalo.App, error) { | ||
ctx := context.Background() | ||
store, err := GetStorage() | ||
if err != nil { | ||
err = fmt.Errorf("error getting storage configuration (%s)", err) | ||
|
@@ -71,11 +54,6 @@ func App() (*buffalo.App, error) { | |
// to have access to private repos. | ||
initializeNETRC() | ||
|
||
worker, err := getWorker(ctx, store) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
lvl, err := env.LogLevel() | ||
if err != nil { | ||
return nil, err | ||
|
@@ -94,8 +72,6 @@ func App() (*buffalo.App, error) { | |
cors.Default().Handler, | ||
}, | ||
SessionName: "_athens_session", | ||
Worker: worker, | ||
WorkerOff: true, // TODO(marwan): turned off until worker is being used. | ||
Logger: blggr, | ||
}) | ||
if prefix := env.AthensPathPrefix(); prefix != "" { | ||
|
@@ -156,26 +132,3 @@ func App() (*buffalo.App, error) { | |
|
||
return app, nil | ||
} | ||
|
||
func getWorker(ctx context.Context, s storage.Backend) (worker.Worker, error) { | ||
port := env.RedisQueuePortWithDefault(":6379") | ||
w := gwa.New(gwa.Options{ | ||
Pool: &redis.Pool{ | ||
MaxActive: 5, | ||
MaxIdle: 5, | ||
Wait: true, | ||
Dial: func() (redis.Conn, error) { | ||
return redis.Dial("tcp", port) | ||
}, | ||
}, | ||
Name: FetcherWorkerName, | ||
MaxConcurrency: env.AthensMaxConcurrency(), | ||
}) | ||
|
||
opts := work.JobOptions{ | ||
SkipDead: true, | ||
MaxFails: env.WorkerMaxFails(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same for WorkerMaxFails There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry still used in olympus |
||
} | ||
|
||
return w, w.RegisterWithOptions(FetcherWorkerName, opts, GetProcessCacheMissJob(ctx, s, w)) | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to remove this as well from config package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry still used in olympus