projects
/
pve-guest-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
621b955
)
replication: add schedule_job_now helper
author
Wolfgang Bumiller
<w.bumiller@proxmox.com>
Wed, 28 Jun 2017 09:35:06 +0000
(11:35 +0200)
committer
Dietmar Maurer
<dietmar@proxmox.com>
Wed, 28 Jun 2017 09:54:11 +0000
(11:54 +0200)
PVE/ReplicationState.pm
patch
|
blob
|
blame
|
history
diff --git
a/PVE/ReplicationState.pm
b/PVE/ReplicationState.pm
index 74c95f9bf7192a130560764164a54c08508775b4..43c8a76c9c814548364032842b37a41bda475ade 100644
(file)
--- a/
PVE/ReplicationState.pm
+++ b/
PVE/ReplicationState.pm
@@
-317,4
+317,16
@@
sub get_next_job {
return undef;
}
+sub schedule_job_now {
+ my ($jobcfg) = @_;
+ PVE::GuestHelpers::guest_migration_lock($jobcfg->{guest}, undef, sub {
+ PVE::Tools::lock_file($state_lock, 10, sub {
+ my $state = read_job_state($jobcfg);
+ $state->{last_try} = 0;
+ write_job_state($jobcfg, $state);
+ });
+ die $@ if $@;
+ });
+}
+
1;