[gnome-ostree/wip/simple-cleanups: 16/19] 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: 16/19] task: Move code down here
- Date: Thu, 13 Jun 2013 18:40:00 +0000 (UTC)
commit f98474c0253a8836fc6bbd2ec53e1387d754b8d0
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 00630c3..da99357 100644
--- a/src/js/task.js
+++ b/src/js/task.js
@@ -479,6 +479,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,
@@ -493,19 +507,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]