There is a private API in the /reload/reload.js package to do this. Since the API is private, it can change, but here's how it works:
Example:
if (Meteor.isClient) { var firstTime = true; function onMigrate (retry) { if (firstTime) { console.log("retrying migration in 3 seconds"); firstTime = false; Meteor.setTimeout(function () { retry(); }, 3000); return false; } else { return [true]; } } Meteor._reload.onMigrate("someName", onMigrate);
From the comments in packages/reload/reload.js :
Packages that support migration must be registered by calling this function. When it migrates, the callback will be called with one argument, the "repeat function". If the package is ready to migrate, it should return [true, data], where the data is its data migration, an arbitrary JSON value (or [true] if it does not have migration data this time). If the package has more time before it is ready to migrate, it should return false. Then, once it is ready to migrate again, it should call the snooze function. The snooze function will return immediately, but plan to re-migrate that each packet will be tried again to migrate the data. If they are all ready this time, then migration will occur. the name must be set if there is migration data.
source share