зеркало из https://github.com/golang/pkgsite.git
many: rename etl to worker
Miscellaneous renames. Updates b/150864416. Change-Id: I3816a8f652c9ced989d9c929d2c2d42734c2f5b3 Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/686711 CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com> Reviewed-by: Julie Qiu <julieqiu@google.com>
This commit is contained in:
Родитель
3c351f115d
Коммит
312ebec2bc
|
@ -202,7 +202,7 @@ func readProxyRemoved(ctx context.Context) {
|
|||
// populateExcluded adds each element of excludedPrefixes to the excluded_prefixes
|
||||
// table if it isn't already present.
|
||||
func populateExcluded(ctx context.Context, db *postgres.DB) {
|
||||
const excludedFilename = "cmd/etl/excluded.txt"
|
||||
const excludedFilename = "cmd/worker/excluded.txt"
|
||||
lines, err := readFileLines(excludedFilename)
|
||||
if err != nil {
|
||||
log.Fatal(ctx, err)
|
||||
|
|
|
@ -18,7 +18,7 @@ import (
|
|||
const keySep = "|"
|
||||
|
||||
// Redis keys for completion sorted sets ("indexes"). They are in this package
|
||||
// so that they can be accessed by both ETL and frontend.
|
||||
// so that they can be accessed by both worker and frontend.
|
||||
const (
|
||||
KeyPrefix = "completions"
|
||||
PopularKey = KeyPrefix + "Popular"
|
||||
|
|
|
@ -119,7 +119,7 @@ type IndexVersion struct {
|
|||
Timestamp time.Time
|
||||
}
|
||||
|
||||
// ModuleVersionState holds an ETL module version state.
|
||||
// ModuleVersionState holds a worker module version state.
|
||||
type ModuleVersionState struct {
|
||||
ModulePath string
|
||||
Version string
|
||||
|
@ -159,7 +159,7 @@ type ModuleVersionState struct {
|
|||
GoModPath string
|
||||
}
|
||||
|
||||
// PackageVersionState holds an ETL package version state. It is associated
|
||||
// PackageVersionState holds a worker package version state. It is associated
|
||||
// with a given module version state.
|
||||
type PackageVersionState struct {
|
||||
PackagePath string
|
||||
|
@ -194,7 +194,7 @@ type SearchResult struct {
|
|||
}
|
||||
|
||||
// Experiment holds data associated with an experimental feature for frontend
|
||||
// or ETL.
|
||||
// or worker.
|
||||
type Experiment struct {
|
||||
// Name is the name of the feature.
|
||||
Name string
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
package fetch
|
||||
|
||||
// Limits for discovery ETL.
|
||||
// Limits for discovery worker.
|
||||
const (
|
||||
maxPackagesPerModule = 10000
|
||||
maxImportsPerPackage = 1000
|
||||
|
|
|
@ -20,7 +20,7 @@ import (
|
|||
"golang.org/x/net/context/ctxhttp"
|
||||
)
|
||||
|
||||
// A Client is used by the etl service to communicate with the module index.
|
||||
// A Client is used by the worker service to communicate with the module index.
|
||||
type Client struct {
|
||||
// URL of the module index
|
||||
url string
|
||||
|
|
|
@ -44,7 +44,7 @@ func (l LocalLogger) Log(entry logging.Entry) {
|
|||
// off.
|
||||
//
|
||||
// Logs may be viewed in Pantheon by selecting the log source corresponding to
|
||||
// the AppEngine service name (e.g. 'dev-etl').
|
||||
// the AppEngine service name (e.g. 'dev-worker').
|
||||
func RequestLog(lg Logger) Middleware {
|
||||
return func(h http.Handler) http.Handler {
|
||||
return &handler{delegate: h, logger: lg}
|
||||
|
|
|
@ -35,7 +35,7 @@ func (db *DB) IsExcluded(ctx context.Context, path string) (_ bool, err error) {
|
|||
//
|
||||
// For real-time administration (e.g. DOS prevention), use devtools/cmd/dbadmin
|
||||
// to exclude or unexclude a prefix. If the exclusion is permanent (e.g. a user
|
||||
// request), also add the prefix and reason to excludedPrefixes in cmd/etl.
|
||||
// request), also add the prefix and reason to the excluded.txt file.
|
||||
func (db *DB) InsertExcludedPrefix(ctx context.Context, prefix, user, reason string) (err error) {
|
||||
defer derrors.Wrap(&err, "DB.InsertExcludedPrefix(ctx, %q, %q)", prefix, reason)
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ func (db *DB) InsertModule(ctx context.Context, m *internal.Module) (err error)
|
|||
//
|
||||
// Note that we end up here only if we first saw the alternative version
|
||||
// (github.com/Sirupsen/logrus@v1.1.0 in the example) and then see the valid
|
||||
// one. The "if code == 491" section of internal/etl.fetchAndUpdateState
|
||||
// one. The "if code == 491" section of internal/worker.fetchAndUpdateState
|
||||
// handles the case where we fetch the versions in the other order.
|
||||
row := db.db.QueryRow(ctx, `
|
||||
SELECT 1 FROM module_version_states
|
||||
|
|
|
@ -874,7 +874,7 @@ func isInternalPackage(path string) bool {
|
|||
|
||||
// DeleteOlderVersionFromSearchDocuments deletes from search_documents every package with
|
||||
// the given module path whose version is older than the given version.
|
||||
// It is used when fetching a module with an alternative path. See etl/fetch.go:fetchAndUpdateState.
|
||||
// It is used when fetching a module with an alternative path. See internal/worker/fetch.go:fetchAndUpdateState.
|
||||
func (db *DB) DeleteOlderVersionFromSearchDocuments(ctx context.Context, modulePath, version string) (err error) {
|
||||
defer derrors.Wrap(&err, "DeleteOlderVersionFromSearchDocuments(ctx, %q, %q)", modulePath, version)
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ type versionKey struct {
|
|||
modulePath, version string
|
||||
}
|
||||
|
||||
// versionEntry holds the result of a call to etl.FetchVersion.
|
||||
// versionEntry holds the result of a call to worker.FetchVersion.
|
||||
type versionEntry struct {
|
||||
module *internal.Module
|
||||
err error
|
||||
|
|
Загрузка…
Ссылка в новой задаче