Skip to content

Commit

Permalink
Move special flags for mig_jcr.
Browse files Browse the repository at this point in the history
We need to set the duplicate checking and maxtime check flags on
a mig_jcr to disables as soon as we instantiated the mig_jcr as
setup_job() already evaluates if the Job is a duplicate.

Fixes #318: copy jobs & cancel duplicates
  • Loading branch information
Marco van Wieringen committed Jul 16, 2014
1 parent 2d87ed5 commit b050007
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/dird/migrate.c
Expand Up @@ -218,6 +218,17 @@ bool do_migration_init(JCR *jcr)
* and set the jcr suppress_output boolean to true).
*/
set_jcr_defaults(mig_jcr, prev_job);

/*
* Don't let WatchDog checks Max*Time value on this Job
*/
mig_jcr->no_maxtime = true;

/*
* Don't check for duplicates on migration and copy jobs
*/
mig_jcr->IgnoreDuplicateJobChecking = true;

if (!setup_job(mig_jcr, true)) {
Jmsg(jcr, M_FATAL, 0, _("setup job failed.\n"));
return false;
Expand All @@ -239,19 +250,9 @@ bool do_migration_init(JCR *jcr)
mig_jcr->jr.PoolId = jcr->jr.PoolId;
mig_jcr->jr.JobId = mig_jcr->JobId;

/*
* Don't let WatchDog checks Max*Time value on this Job
*/
mig_jcr->no_maxtime = true;

/*
* Don't check for duplicates on migration and copy jobs
*/
mig_jcr->res.job->IgnoreDuplicateJobChecking = true;

Dmsg4(dbglevel, "mig_jcr: Name=%s JobId=%d Type=%c Level=%c\n",
mig_jcr->jr.Name, (int)mig_jcr->jr.JobId,
mig_jcr->jr.JobType, mig_jcr->jr.JobLevel);
mig_jcr->jr.Name, (int)mig_jcr->jr.JobId, mig_jcr->jr.JobType,
mig_jcr->jr.JobLevel);

if (set_migration_next_pool(jcr, &pool)) {
/*
Expand Down

0 comments on commit b050007

Please sign in to comment.