Skip to content

Commit

Permalink
chore: adjusting name text
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwelbm committed May 17, 2024
1 parent cdd0af0 commit 1aa2735
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion messages/edge_storage/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ const (
ERROR_CREATE_OBJECT = "Failed to create the object: %s. Check your settings and try again. If the error persists, contact Azion support."
ERROR_DELETE_OBJECT = "Failed to delete the Object: %s. Check your settings and try again. If the error persists, contact Azion support."
ERROR_DESCRIBE_OBJECT = "Failed to describe the object: %s. Check your settings and try again. If the error persists, contact Azion support."
ERROR_NO_EMPTY_BUCKET = "Unable to delete a non-empty bucket. Additionally, objects deleted within the last 24 hours are also taken into consideration"
ERROR_NO_EMPTY_BUCKET = "Unable to delete a non-empty bucket. Additionally, objects deleted within the last 24 hours are also taken into consideration."
)
18 changes: 9 additions & 9 deletions pkg/schedule/schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ func NewSchedule(name string, kind string) error {
Kind: kind,
}

schedules, err := readFileShedule()
schedules, err := readFileSchedule()
if err != nil {
logger.Debug("read shedule error", zap.Error(err))
logger.Debug("Error while reading the schedule", zap.Error(err))
return err
}
schedules = append(schedules, schedule)

err = createFileShedule(schedules)
err = createFileSchedule(schedules)
if err != nil {
logger.Debug("scheduling error", zap.Error(err))
logger.Debug("Scheduling error", zap.Error(err))
return err
}
return nil
}

func createFileShedule(shedule []Schedule) error {
func createFileSchedule(shedule []Schedule) error {
b, err := json.MarshalIndent(shedule, " ", " ")
if err != nil {
return err
Expand All @@ -53,7 +53,7 @@ func createFileShedule(shedule []Schedule) error {
return os.WriteFile(path, b, os.FileMode(os.O_CREATE))
}

func readFileShedule() ([]Schedule, error) {
func readFileSchedule() ([]Schedule, error) {
configPath, err := config.Dir()
if err != nil {
return nil, err
Expand Down Expand Up @@ -93,17 +93,17 @@ func readFileShedule() ([]Schedule, error) {
}

func ExecSchedules(factory *cmdutil.Factory) {
schedules, err := readFileShedule()
schedules, err := readFileSchedule()
if err != nil {
logger.Debug("read shedule error", zap.Error(err))
logger.Debug("Error while reading the schedule", zap.Error(err))
return
}

for _, s := range schedules {
if CheckIf24HoursPassed(s.Time) {
if s.Kind == DELETE_BUCKET {
if err := TriggerDeleteBucket(factory, s.Name); err != nil {
logger.Debug("event execution error", zap.Error(err))
logger.Debug("Event execution error", zap.Error(err))
}
}
}
Expand Down

0 comments on commit 1aa2735

Please sign in to comment.