def sendpushkeymessages(ui, repo):
    for namespace, key, old, new, ret in repo._replicationinfo['pushkey']:

        start = time.time()
        vcsrproducer.record_hg_pushkey(ui.replicationproducer,
                                       repo.replicationwireprotopath,
                                       namespace,
                                       key,
                                       old,
                                       new,
                                       ret,
                                       partition=repo.replicationpartition)
        duration = time.time() - start
        ui.status(_('recorded updates to %s in replication log in %.3fs\n') % (
                    namespace, duration))
Example #2
0
def sendpushkeymessage(ui, repo, namespace, key, old, new, ret):
    """Send a pushkey replication message."""
    with ui.kafkainteraction():
        repo.producerlog('PUSHKEY_SENDING')
        start = time.time()
        vcsrproducer.record_hg_pushkey(ui.replicationproducer,
                                       repo.replicationwireprotopath,
                                       namespace,
                                       key,
                                       old,
                                       new,
                                       ret,
                                       partition=repo.replicationpartition)
        duration = time.time() - start
        repo.producerlog('PUSHKEY_SENT')
        ui.status(_('recorded updates to %s in replication log in %.3fs\n') % (
            namespace, duration))
Example #3
0
def sendpushkeymessages(ui, repo):
    """Send messages indicating updates to pushkey values."""
    for namespace, key, old, new, ret in repo._replicationinfo['pushkey']:
        with ui.kafkainteraction():
            repo.producerlog('PUSHKEY_SENDING')
            start = time.time()
            vcsrproducer.record_hg_pushkey(ui.replicationproducer,
                                           repo.replicationwireprotopath,
                                           namespace,
                                           key,
                                           old,
                                           new,
                                           ret,
                                           partition=repo.replicationpartition)
            duration = time.time() - start
            repo.producerlog('PUSHKEY_SENT')
            ui.status(_('recorded updates to %s in replication log in %.3fs\n') % (
                        namespace, duration))