Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Un - provisioning an application #10

Open
mikeytrw opened this issue Aug 18, 2010 · 6 comments
Open

Un - provisioning an application #10

mikeytrw opened this issue Aug 18, 2010 · 6 comments

Comments

@mikeytrw
Copy link

If multiple requests for provisioning an appID are ignored, we shouldn't we add a method for killing a provision - to allow for updating PEM files without restarting the server?

@samuraisam
Copy link
Owner

Good idea

@mikeytrw
Copy link
Author

Line 273:

def xmlrpc_unprovision(self,app_id,environment):
""" Stops an APNSService and removes it from the list of appIDs

    Arguments:
      app_id                 the app_id to provision for APNS
      environment            either 'sandbox' or 'production'

    Returns:
      None
    """
if app_id in self.app_ids:
  self.apns_service(app_id).stopService()
  del self.app_ids[app_id]
else:
  raise xmlrpc.Fault(500, 'That AppID does not exist.')

@mikeytrw
Copy link
Author

I was going to add the ability to have an app provisioned for sandbox and production, hence the environment parameter which is currently ignored

@samuraisam
Copy link
Owner

Be warned that this may affect notifications that are currently in transmission. It will likely be a very small amount and a corner case but could still cancel some notifications, depending on your load.

@mikeytrw
Copy link
Author

Good point. Will amend as necessary.

@samuraisam
Copy link
Owner

This is the reason I didn't support it originally. If you want to ensure delivery, you can keep a copy of all the transmissions' deferreds in an instance variable on the server class. When each one completes or fails, clean up. When un-provisioning, spin until all deferreds in that list are cleaned up, or time them out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants