From 42486413285af8e4c67cf56c761f938794ca904f Mon Sep 17 00:00:00 2001 From: KevinWu0904 <37426896+KevinWu0904@users.noreply.github.com> Date: Wed, 7 Jul 2021 03:22:07 +0800 Subject: [PATCH] fix typos (#1005) fix typos --- cmd/dkron.go | 4 ++-- dkron/execution.go | 2 +- dkron/fsm.go | 2 +- dkron/grpc_client.go | 2 +- dkron/job.go | 8 ++++---- dkron/raft_grpc.go | 4 ++-- dkron/scheduler.go | 4 ++-- dkron/storage.go | 2 +- dkron/store.go | 2 +- dkron/store_test.go | 2 +- plugin/execution_processor.go | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cmd/dkron.go b/cmd/dkron.go index dfcc9c8c2..c807a9f5d 100644 --- a/cmd/dkron.go +++ b/cmd/dkron.go @@ -64,7 +64,7 @@ func initConfig() { } if err := viper.Unmarshal(config); err != nil { - logrus.WithError(err).Fatal("config: Error unmarshaling config") + logrus.WithError(err).Fatal("config: Error unmarshalling config") } cliTags := viper.GetStringSlice("tag") @@ -73,7 +73,7 @@ func initConfig() { if len(cliTags) > 0 { tags, err = UnmarshalTags(cliTags) if err != nil { - logrus.WithError(err).Fatal("config: Error unmarshaling cli tags") + logrus.WithError(err).Fatal("config: Error unmarshalling cli tags") } } else { tags = viper.GetStringMapString("tags") diff --git a/dkron/execution.go b/dkron/execution.go index dd0cbf117..001f252f1 100644 --- a/dkron/execution.go +++ b/dkron/execution.go @@ -23,7 +23,7 @@ type Execution struct { // When the execution finished running. FinishedAt time.Time `json:"finished_at,omitempty"` - // If this execution executed succesfully. + // If this execution executed successfully. Success bool `json:"success"` // Partial output of the execution. diff --git a/dkron/fsm.go b/dkron/fsm.go index fe7351800..6bb1d660d 100644 --- a/dkron/fsm.go +++ b/dkron/fsm.go @@ -21,7 +21,7 @@ const ( SetExecutionType // DeleteExecutionsType is the command used to delete executions from the store. DeleteExecutionsType - // ExecutionDoneType is the command to perform the logic needed once an exeuction + // ExecutionDoneType is the command to perform the logic needed once an execution // is done. ExecutionDoneType ) diff --git a/dkron/grpc_client.go b/dkron/grpc_client.go index e0700dd19..3ea3c1601 100644 --- a/dkron/grpc_client.go +++ b/dkron/grpc_client.go @@ -425,7 +425,7 @@ func (grpcc *GRPCClient) AgentRun(addr string, job *proto.Job, execution *proto. // Error received from the stream if err != nil { - // At this point the execution status will be unknown, set the FinshedAt time and an explanatory message + // At this point the execution status will be unknown, set the FinishedAt time and an explanatory message execution.FinishedAt = ptypes.TimestampNow() execution.Output = []byte(err.Error()) diff --git a/dkron/job.go b/dkron/job.go index d02c0c5f4..75faf7c0a 100644 --- a/dkron/job.go +++ b/dkron/job.go @@ -24,8 +24,8 @@ const ( StatusRunning = "running" // StatusFailed is status of a job whose last run was not successful on any nodes. StatusFailed = "failed" - // StatusPartialyFailed is status of a job whose last run was successful on only some nodes. - StatusPartialyFailed = "partially_failed" + // StatusPartiallyFailed is status of a job whose last run was successful on only some nodes. + StatusPartiallyFailed = "partially_failed" // ConcurrencyAllow allows a job to execute concurrency. ConcurrencyAllow = "allow" @@ -48,7 +48,7 @@ var ( ErrWrongConcurrency = errors.New("invalid concurrency policy value, use \"allow\" or \"forbid\"") ) -// Job descibes a scheduled Job. +// Job describes a scheduled Job. type Job struct { // Job id. Must be unique, it's a copy of name. ID string `json:"id"` @@ -78,7 +78,7 @@ type Job struct { // Number of errors running this job. ErrorCount int `json:"error_count"` - // Last time this job executed succesful. + // Last time this job executed successfully. LastSuccess ntime.NullableTime `json:"last_success"` // Last time this job failed. diff --git a/dkron/raft_grpc.go b/dkron/raft_grpc.go index 122709bda..1674fdf56 100644 --- a/dkron/raft_grpc.go +++ b/dkron/raft_grpc.go @@ -18,12 +18,12 @@ type RaftLayer struct { logger *logrus.Entry } -// NewRaftLayer returns an initialized unecrypted RaftLayer. +// NewRaftLayer returns an initialized unencrypted RaftLayer. func NewRaftLayer(logger *logrus.Entry) *RaftLayer { return &RaftLayer{logger: logger} } -// NewTLSRaftLayer returns an initialized TLS-ecrypted RaftLayer. +// NewTLSRaftLayer returns an initialized TLS-encrypted RaftLayer. func NewTLSRaftLayer(tlsConfig *tls.Config, logger *logrus.Entry) *RaftLayer { return &RaftLayer{ TLSConfig: tlsConfig, diff --git a/dkron/scheduler.go b/dkron/scheduler.go index 3303acefa..e8900ab5d 100644 --- a/dkron/scheduler.go +++ b/dkron/scheduler.go @@ -17,7 +17,7 @@ var ( cronInspect = expvar.NewMap("cron_entries") schedulerStarted = expvar.NewInt("scheduler_started") - // ErrScheduleParse is the error returned when the schdule parsing fails. + // ErrScheduleParse is the error returned when the schedule parsing fails. ErrScheduleParse = errors.New("can't parse job schedule") ) @@ -104,7 +104,7 @@ func (s *Scheduler) ClearCron() { s.Cron = nil } -// Started will safely return if the schduler is started or not +// Started will safely return if the scheduler is started or not func (s *Scheduler) Started() bool { s.mu.RLock() defer s.mu.RUnlock() diff --git a/dkron/storage.go b/dkron/storage.go index 0eb9687e3..771b416be 100644 --- a/dkron/storage.go +++ b/dkron/storage.go @@ -6,7 +6,7 @@ import ( // Storage is the interface that should be used by any // storage engine implemented for dkron. It contains the -// minumum set of operations that are needed to have a working +// minimum set of operations that are needed to have a working // dkron store. type Storage interface { SetJob(job *Job, copyDependentJobs bool) error diff --git a/dkron/store.go b/dkron/store.go index 204c31c49..bc5bec7be 100644 --- a/dkron/store.go +++ b/dkron/store.go @@ -705,7 +705,7 @@ func (s *Store) computeStatus(jobName string, exGroup int64, tx *buntdb.Tx) (str } else if failed > 0 && success == 0 { status = StatusFailed } else if failed > 0 && success > 0 { - status = StatusPartialyFailed + status = StatusPartiallyFailed } return status, nil diff --git a/dkron/store_test.go b/dkron/store_test.go index 753d34766..629840f5b 100644 --- a/dkron/store_test.go +++ b/dkron/store_test.go @@ -275,7 +275,7 @@ func Test_computeStatus(t *testing.T) { // Tests status err = s.db.View(func(tx *buntdb.Tx) error { status, _ := s.computeStatus("test", 1, tx) - assert.Equal(t, StatusPartialyFailed, status) + assert.Equal(t, StatusPartiallyFailed, status) status, _ = s.computeStatus("test", 2, tx) assert.Equal(t, StatusSuccess, status) diff --git a/plugin/execution_processor.go b/plugin/execution_processor.go index 95dbc1090..45e36d81c 100644 --- a/plugin/execution_processor.go +++ b/plugin/execution_processor.go @@ -67,7 +67,7 @@ type ProcessorServer struct { Processor Processor } -// Process will call the actuall Process method of the plugin +// Process will call the actual Process method of the plugin func (e *ProcessorServer) Process(args *ProcessorArgs, resp *types.Execution) error { *resp = e.Processor.Process(args) return nil