Updated Branches: refs/heads/4.1 00176870e -> 68f51a3db
CLOUDSTACK-2523: Recurring snapshot failed with NPE. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/68f51a3d Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/68f51a3d Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/68f51a3d Branch: refs/heads/4.1 Commit: 68f51a3db90ff6ddea3bb6f2106bd4f49b2f0393 Parents: 0017687 Author: Min Chen <[email protected]> Authored: Thu May 23 17:22:44 2013 -0700 Committer: Milamber <[email protected]> Committed: Tue Jun 18 12:43:22 2013 +0100 ---------------------------------------------------------------------- .../src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/68f51a3d/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java index 5af0af0..9b6d218 100644 --- a/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java @@ -56,6 +56,7 @@ import com.cloud.utils.DateUtil; import com.cloud.utils.DateUtil.IntervalType; import com.cloud.utils.NumbersUtil; +import com.cloud.utils.component.ComponentContext; import com.cloud.utils.component.ManagerBase; import com.cloud.utils.concurrency.TestClock; import com.cloud.utils.db.DB; @@ -75,7 +76,7 @@ public class SnapshotSchedulerImpl extends ManagerBase implements SnapshotSchedu @Inject protected AsyncJobManager _asyncMgr; @Inject protected VolumeDao _volsDao; @Inject protected ConfigurationDao _configDao; - + private static final int ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_COOPERATION = 5; // 5 seconds private int _snapshotPollInterval; private Timer _testClockTimer; @@ -246,6 +247,7 @@ public class SnapshotSchedulerImpl extends ManagerBase implements SnapshotSchedu params.put("ctxStartEventId", String.valueOf(eventId)); CreateSnapshotCmd cmd = new CreateSnapshotCmd(); + ComponentContext.inject(cmd); ApiDispatcher.getInstance().dispatchCreateCmd(cmd, params); params.put("id", ""+cmd.getEntityId()); params.put("ctxStartEventId", "1"); @@ -350,7 +352,7 @@ public class SnapshotSchedulerImpl extends ManagerBase implements SnapshotSchedu _testTimerTask = new TestClock(this, minutesPerHour, hoursPerDay, daysPerWeek, daysPerMonth, weeksPerMonth, monthsPerYear); } _currentTimestamp = new Date(); - + s_logger.info("Snapshot Scheduler is configured."); return true;
