Skip to content

Commit

Permalink
feat: Introduce disableFetchRevisions config flag
Browse files Browse the repository at this point in the history
If you pass this flag then `fetchRevisions` doesn't attempt to fetch _any_ revisions
from S3. This is useful because fetching the revisions from S3 can take a long time
(see #120) and if you don't have any reason to use them then this time is wasted.

In our use case I have hooked this flag up to an environment variable. e.g. - in `deploy.js`:

```
disableFetchRevisions: process.env.DISABLE_FETCH_REVISIONS
```

Then we can set that environment variable when we are calling the `activate`
command and leave it off at any other time (so e.g. `ember deploy:list` works as
expected - if you have the time to wait)
  • Loading branch information
Kelvin Luck committed Jul 4, 2022
1 parent 323a972 commit f8c3208
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ module.exports = {
},

fetchRevisions: function(context) {
if (this.readConfig('disableFetchRevisions')) {
this.log('fetchRevisions - not fetching any revisions', { verbose: true });
return {
activations: []
};
};

return this._list(context)
.then(function(revisions) {
return {
Expand Down

0 comments on commit f8c3208

Please sign in to comment.