Skip to content

Commit

Permalink
fix some typos
Browse files Browse the repository at this point in the history
Signed-off-by: cui fliter <imcusg@gmail.com>
  • Loading branch information
cuishuang authored and hibiken committed Jan 6, 2023
1 parent 783071c commit cc777eb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Task queues are used as a mechanism to distribute work across multiple machines.

**Status**: The library is currently undergoing **heavy development** with frequent, breaking API changes.

> ☝️ **Important Note**: Current major version is zero (`v0.x.x`) to accomodate rapid development and fast iteration while getting early feedback from users (_feedback on APIs are appreciated!_). The public API could change without a major version update before `v1.0.0` release.
> ☝️ **Important Note**: Current major version is zero (`v0.x.x`) to accommodate rapid development and fast iteration while getting early feedback from users (_feedback on APIs are appreciated!_). The public API could change without a major version update before `v1.0.0` release.
## Quickstart

Expand Down
4 changes: 2 additions & 2 deletions heartbeat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
// Test goes through a few phases.
//
// Phase1: Simulate Server startup; Simulate starting tasks listed in startedWorkers
// Phase2: Simluate finishing tasks listed in finishedTasks
// Phase2: Simulate finishing tasks listed in finishedTasks
// Phase3: Simulate Server shutdown;
func TestHeartbeater(t *testing.T) {
r := setup(t)
Expand All @@ -41,7 +41,7 @@ func TestHeartbeater(t *testing.T) {
t5 := h.NewTaskMessageWithQueue("task5", nil, "custom")
t6 := h.NewTaskMessageWithQueue("task6", nil, "default")

// Note: intentionally set to time less than now.Add(rdb.LeaseDuration) to test lease extention is working.
// Note: intentionally set to time less than now.Add(rdb.LeaseDuration) to test lease extension is working.
lease1 := h.NewLeaseWithClock(now.Add(10*time.Second), clock)
lease2 := h.NewLeaseWithClock(now.Add(10*time.Second), clock)
lease3 := h.NewLeaseWithClock(now.Add(10*time.Second), clock)
Expand Down
8 changes: 4 additions & 4 deletions internal/rdb/rdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (r *RDB) runScript(ctx context.Context, op errors.Op, script *redis.Script,
return nil
}

// Runs the given script with keys and args and retuns the script's return value as int64.
// Runs the given script with keys and args and returns the script's return value as int64.
func (r *RDB) runScriptWithErrorCode(ctx context.Context, op errors.Op, script *redis.Script, keys []string, args ...interface{}) (int64, error) {
res, err := script.Run(ctx, r.client, keys, args...).Result()
if err != nil {
Expand Down Expand Up @@ -368,7 +368,7 @@ func (r *RDB) Done(ctx context.Context, msg *base.TaskMessage) error {
//
// ARGV[1] -> task ID
// ARGV[2] -> stats expiration timestamp
// ARGV[3] -> task exipration time in unix time
// ARGV[3] -> task expiration time in unix time
// ARGV[4] -> task message data
// ARGV[5] -> max int64 value
var markAsCompleteCmd = redis.NewScript(`
Expand Down Expand Up @@ -405,7 +405,7 @@ return redis.status_reply("OK")
//
// ARGV[1] -> task ID
// ARGV[2] -> stats expiration timestamp
// ARGV[3] -> task exipration time in unix time
// ARGV[3] -> task expiration time in unix time
// ARGV[4] -> task message data
// ARGV[5] -> max int64 value
var markAsCompleteUniqueCmd = redis.NewScript(`
Expand Down Expand Up @@ -1086,7 +1086,7 @@ const aggregationTimeout = 2 * time.Minute
// The time for gracePeriod and maxDelay is computed relative to the time t.
//
// Note: It assumes that this function is called at frequency less than or equal to the gracePeriod. In other words,
// the function only checks the most recently added task aganist the given gracePeriod.
// the function only checks the most recently added task against the given gracePeriod.
func (r *RDB) AggregationCheck(qname, gname string, t time.Time, gracePeriod, maxDelay time.Duration, maxSize int) (string, error) {
var op errors.Op = "RDB.AggregationCheck"
aggregationSetID := uuid.NewString()
Expand Down
2 changes: 1 addition & 1 deletion internal/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func SeedLease(tb testing.TB, r redis.UniversalClient, entries []base.Z, qname s
seedRedisZSet(tb, r, base.LeaseKey(qname), entries, base.TaskStateActive)
}

// SeedCompletedQueue initializes the completed set witht the given entries.
// SeedCompletedQueue initializes the completed set with the given entries.
func SeedCompletedQueue(tb testing.TB, r redis.UniversalClient, entries []base.Z, qname string) {
tb.Helper()
r.SAdd(context.Background(), base.AllQueues, qname)
Expand Down
2 changes: 1 addition & 1 deletion recoverer.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (r *recoverer) recover() {
}

func (r *recoverer) recoverLeaseExpiredTasks() {
// Get all tasks which have expired 30 seconds ago or earlier to accomodate certain amount of clock skew.
// Get all tasks which have expired 30 seconds ago or earlier to accommodate certain amount of clock skew.
cutoff := time.Now().Add(-30 * time.Second)
msgs, err := r.broker.ListLeaseExpired(cutoff, r.queues...)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions tools/asynq/cmd/dash/draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ func nextTaskState(current asynq.TaskState) asynq.TaskState {
}
}
}
panic("unkown task state")
panic("unknown task state")
}

func prevTaskState(current asynq.TaskState) asynq.TaskState {
Expand All @@ -459,7 +459,7 @@ func prevTaskState(current asynq.TaskState) asynq.TaskState {
}
}
}
panic("unkown task state")
panic("unknown task state")
}

func getTaskCount(queue *asynq.QueueInfo, taskState asynq.TaskState) int {
Expand Down

0 comments on commit cc777eb

Please sign in to comment.