Skip to content
This repository was archived by the owner on Dec 25, 2020. It is now read-only.

Commit

Permalink
Reload snapshot status periodically until it is fully transferred to …
Browse files Browse the repository at this point in the history
…the cloud
  • Loading branch information
drauschenbach committed Oct 9, 2019
1 parent 6be16b3 commit 6f7f429
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 143 deletions.
13 changes: 13 additions & 0 deletions app/components/snapshot-status.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
import Component from '@ember/component';
import { task, timeout } from 'ember-concurrency';

export default Component.extend({
reloadModel: task(function * () {
let snapshot = this.get('snapshot');
while (true) {
if (snapshot.get('progress') == 100) {
break;
}
if (snapshot.isLoaded) {
snapshot.reload();
}
yield timeout(1000);
}
}).on('init').restartable()
});
148 changes: 5 additions & 143 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"ember-cli-sri": "^2.1.1",
"ember-cli-template-lint": "^1.0.0-beta.1",
"ember-cli-uglify": "^2.1.0",
"ember-concurrency": "^1.1.0",
"ember-data": "~3.10.0",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^2.0.0",
Expand Down

0 comments on commit 6f7f429

Please sign in to comment.