Skip to content

Commit

Permalink
Fix panic in task scheduling
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuradobery committed Jan 10, 2025
1 parent d229890 commit 7e4c9af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cloud/disk_manager/internal/pkg/dataplane/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func RegisterForExecution(
}

if migrationDestinationStorage != nil {
err = taskRegistry.Register("dataplane.MigrateSnapshotToAnotherDatabaseTask", func() tasks.Task {
err = taskRegistry.RegisterForExecution("dataplane.MigrateSnapshotToAnotherDatabaseTask", func() tasks.Task {
return &migrateSnapshotToAnotherDatabaseTask{
sourceStorage: storage,
destinationStorage: migrationDestinationStorage,
Expand Down
6 changes: 4 additions & 2 deletions cloud/disk_manager/pkg/admin/snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ func (c *scheduleCreateSnapshotFromLegacySnapshotTask) run() error {
logging.Info(ctx, "Creating task scheduler")
taskRegistry := tasks.NewRegistry()

*(c.serverConfig.TasksConfig).RegularSystemTasksEnabled = false
regularSystemTasksEnabled := false
c.serverConfig.TasksConfig.RegularSystemTasksEnabled = &regularSystemTasksEnabled
taskScheduler, err := tasks.NewScheduler(
ctx,
taskRegistry,
Expand Down Expand Up @@ -362,7 +363,8 @@ func (c *scheduleMigrateSnapshotToAnotherDatabaseTaskCmd) run() error {
logging.Info(ctx, "Creating task scheduler")
taskRegistry := tasks.NewRegistry()

*(c.serverConfig.TasksConfig).RegularSystemTasksEnabled = false
regularSystemTasksEnabled := false
c.serverConfig.TasksConfig.RegularSystemTasksEnabled = &regularSystemTasksEnabled
taskScheduler, err := tasks.NewScheduler(
ctx,
taskRegistry,
Expand Down

0 comments on commit 7e4c9af

Please sign in to comment.