[gnome-ostree/wip/simple-cleanups: 17/23] task: Move code down here
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-ostree/wip/simple-cleanups: 17/23] task: Move code down here
- Date: Thu, 13 Jun 2013 18:48:15 +0000 (UTC)
commit 00e009c896a0e1b221c7252cb7f231d9586ec89a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Jun 13 14:33:28 2013 -0400
task: Move code down here
We want to rely on stuff calculated above when generating the meta.json
file.
src/js/task.js | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/src/js/task.js b/src/js/task.js
index 04d6987..960aa16 100644
--- a/src/js/task.js
+++ b/src/js/task.js
@@ -486,6 +486,20 @@ const TaskDef = new Lang.Class({
let [success, errmsg] = ProcUtil.asyncWaitCheckFinish(proc, result);
let target;
+ if (!success) {
+ target = this._failedDir.get_child(this._version);
+ GSystem.file_rename(this._taskCwd, target, null);
+ this._taskCwd = target;
+ this._cleanOldVersions(this._failedDir, this.RetainFailed, null);
+ this.onComplete(success, errmsg);
+ } else {
+ target = this._successDir.get_child(this._version);
+ GSystem.file_rename(this._taskCwd, target, null);
+ this._taskCwd = target;
+ this._cleanOldVersions(this._successDir, this.RetainSuccess, null);
+ this.onComplete(success, null);
+ }
+
let elapsedMillis = GLib.get_monotonic_time() / 1000 - this._startTimeMillis;
let meta = { taskMetaVersion: 0,
taskVersion: this._version,
@@ -500,19 +514,6 @@ const TaskDef = new Lang.Class({
JsonUtil.writeJsonFileAtomic(this._taskCwd.get_child('meta.json'), meta, cancellable);
- if (!success) {
- target = this._failedDir.get_child(this._version);
- GSystem.file_rename(this._taskCwd, target, null);
- this._taskCwd = target;
- this._cleanOldVersions(this._failedDir, this.RetainFailed, null);
- this.onComplete(success, errmsg);
- } else {
- target = this._successDir.get_child(this._version);
- GSystem.file_rename(this._taskCwd, target, null);
- this._taskCwd = target;
- this._cleanOldVersions(this._successDir, this.RetainSuccess, null);
- this.onComplete(success, null);
- }
// Also remove any old interrupted versions
this._cleanOldVersions(this.dir, 0, null);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]