mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
AppId-dependant HCP
This commit is contained in:
@@ -182,7 +182,8 @@ var retry = new Retry({
|
||||
var failures = 0;
|
||||
|
||||
Autoupdate._retrySubscription = function () {
|
||||
Meteor.subscribe("meteor_autoupdate_clientVersions", {
|
||||
var appId = __meteor_runtime_config__.appId;
|
||||
Meteor.subscribe("meteor_autoupdate_clientVersions", appId, {
|
||||
onError: function (err) {
|
||||
Meteor._debug("autoupdate subscription failed:", err);
|
||||
failures++;
|
||||
@@ -216,3 +217,4 @@ Autoupdate._retrySubscription = function () {
|
||||
};
|
||||
|
||||
Meteor.startup(Autoupdate._retrySubscription);
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ ClientVersions = new Mongo.Collection("meteor_autoupdate_clientVersions",
|
||||
Autoupdate.autoupdateVersion = null;
|
||||
Autoupdate.autoupdateVersionRefreshable = null;
|
||||
Autoupdate.autoupdateVersionCordova = null;
|
||||
Autoupdate.appId = __meteor_runtime_config__.appId = process.env.APP_ID;
|
||||
|
||||
var syncQueue = new Meteor._SynchronousQueue();
|
||||
|
||||
@@ -135,7 +136,12 @@ var updateVersions = function (shouldReloadClientProgram) {
|
||||
|
||||
Meteor.publish(
|
||||
"meteor_autoupdate_clientVersions",
|
||||
function () {
|
||||
function (appId) {
|
||||
// Don't notify clients using wrong appId such as mobile apps built with a
|
||||
// different server but pointing at the same local url
|
||||
if (Autoupdate.appId && appId && Autoupdate.appId !== appId)
|
||||
return [];
|
||||
|
||||
return ClientVersions.find();
|
||||
},
|
||||
{is_auto: true}
|
||||
|
||||
@@ -279,7 +279,8 @@ var generateCordovaBoilerplate = function (clientDir, options) {
|
||||
options.host + ':' + options.port,
|
||||
autoupdateVersionCordova: version,
|
||||
cleanCache: options.clean,
|
||||
httpProxyPort: options.httpProxyPort
|
||||
httpProxyPort: options.httpProxyPort,
|
||||
appId: project.appId
|
||||
};
|
||||
|
||||
if (publicSettings)
|
||||
|
||||
Reference in New Issue
Block a user