return 1;
}
- while (ua->jcr->storage->size()) {
- ua->jcr->storage->remove(0);
+ while (ua->jcr->wstorage->size()) {
+ ua->jcr->wstorage->remove(0);
}
len = strlen(ua->argk[0]);
BSOCK *sd;
JCR *jcr = ua->jcr;
- set_storage(jcr, store);
+ set_wstorage(jcr, store);
/* Try connecting for up to 15 seconds */
bsendmsg(ua, _("Connecting to Storage daemon %s at %s:%d\n"),
- store->hdr.name, store->address, store->SDport);
+ store->name(), store->address, store->SDport);
if (!connect_to_storage_daemon(jcr, 1, 15, 0)) {
bsendmsg(ua, _("Failed to connect to Storage daemon.\n"));
return;
/*
* do_job_delete now performs the actual delete operation atomically
- * we always return 1 because C++ is pissy about void functions
*/
static void do_job_delete(UAContext *ua, JobId_t JobId)
{
- POOLMEM *query = get_pool_memory(PM_MESSAGE);
+ POOL_MEM query(PM_MESSAGE);
char ed1[50];
- Mmsg(query, "DELETE FROM Job WHERE JobId=%s", edit_int64(JobId, ed1));
- db_sql_query(ua->db, query, NULL, (void *)NULL);
- Mmsg(query, "DELETE FROM MAC WHERE JobId=%s", ed1);
- db_sql_query(ua->db, query, NULL, (void *)NULL);
- Mmsg(query, "DELETE FROM File WHERE JobId=%s", ed1);
- db_sql_query(ua->db, query, NULL, (void *)NULL);
- Mmsg(query, "DELETE FROM JobMedia WHERE JobId=%s", ed1);
- db_sql_query(ua->db, query, NULL, (void *)NULL);
- free_pool_memory(query);
+ purge_files_from_job(ua, JobId);
+ purge_job_from_catalog(ua, JobId);
bsendmsg(ua, _("Job %s and associated records deleted from the catalog.\n"), edit_int64(JobId, ed1));
}
if (!store) {
return;
}
- set_storage(jcr, store);
+ set_wstorage(jcr, store);
drive = get_storage_drive(ua, store);
Dmsg3(120, "Found storage, MediaType=%s DevName=%s drive=%d\n",