Skip to content

Commit 822c42b

Browse files
author
James Hiscock
committed
Use activationSuffix from config instead of :current
1 parent f156dcc commit 822c42b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ module.exports = {
2828
keyPrefix: function(context){
2929
return context.project.name() + ':index';
3030
},
31+
activationSuffix: 'current',
3132
didDeployMessage: function(context){
3233
var revisionKey = context.revisionData && context.revisionData.revisionKey;
3334
var activatedRevisionKey = context.revisionData && context.revisionData.activatedRevisionKey;
@@ -53,7 +54,7 @@ module.exports = {
5354
if (!this.pluginConfig.url) {
5455
['host', 'port'].forEach(this.applyDefaultConfigProperty.bind(this));
5556
}
56-
['filePattern', 'distDir', 'keyPrefix', 'revisionKey', 'didDeployMessage', 'redisDeployClient'].forEach(this.applyDefaultConfigProperty.bind(this));
57+
['filePattern', 'distDir', 'keyPrefix', 'activationSuffix', 'revisionKey', 'didDeployMessage', 'redisDeployClient'].forEach(this.applyDefaultConfigProperty.bind(this));
5758

5859
this.log('config ok', { verbose: true });
5960
},
@@ -80,9 +81,10 @@ module.exports = {
8081
var redisDeployClient = this.readConfig('redisDeployClient');
8182
var revisionKey = this.readConfig('revisionKey');
8283
var keyPrefix = this.readConfig('keyPrefix');
84+
var activationSuffix = this.readConfig('activationSuffix');
8385

8486
this.log('Activating revision `' + revisionKey + '`', { verbose: true });
85-
return Promise.resolve(redisDeployClient.activate(keyPrefix, revisionKey))
87+
return Promise.resolve(redisDeployClient.activate(keyPrefix, revisionKey, activationSuffix))
8688
.then(this.log.bind(this, '✔ Activated revision `' + revisionKey + '`', {}))
8789
.then(function(){
8890
return {

lib/redis.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ module.exports = CoreObject.extend({
5252
});
5353
},
5454

55-
activate: function(keyPrefix, revisionKey) {
56-
var currentKey = keyPrefix + ':current';
55+
activate: function(keyPrefix, revisionKey, activationSuffix) {
56+
var currentKey = keyPrefix + ':' + activationSuffix;
5757

5858
return Promise.resolve()
5959
.then(this._listRevisions.bind(this, keyPrefix))

0 commit comments

Comments
 (0)