def worker(container, limit, thread_num):

    count = 0

    try:
        # Keep looping until either swift returns an error or bulk delete returns a bad request
        # response
        while True:

            # Get a new auth token every 20 times through the loop
            if count % 20 is 0:
                # Use the Swauth class for v1.0 auth urls
                if "v1.0" in variables.os_auth_url:
                    auth = Swauth(
                        variables.os_auth_url, variables.os_tenant_name, variables.os_username, variables.os_password
                    )
                else:
                    print "Invalid os_auth_url"
                    return
                auth.get_auth_token()

            swift = Swift(auth.auth_token, auth.storage_url, container, limit, thread_num)

            response = swift.bulk_delete_objects()

            print "(%s) %s" % (thread_num, response)

            if swift.status_code != requests.codes.ok:
                print "(%s) (%s) Thread Exited" % (swift.status_code, thread_num)
                return

            if "400 Bad Request" in response:
                print "(%s) (400 Bad Request) Thread Exited" % thread_num
                return

            count += 1
    except KeyboardInterrupt:
        return

    return