Skip to content

[dbal] message delay does not work properly  #418

Closed
@rolandbrecht

Description

@rolandbrecht

Let's assume we have a message like

<?php

use Enqueue\Client\Message;

$message = new Message();
$message->setDelay(60); // seconds

/** @var \Enqueue\Client\ProducerInterface $producer */
$producer->sendEvent('aTopic', `$message);

Based on the documentation, the delay is in seconds.

In DbalProducer.php you act on the assumption, that you are not working with seconds, divide them with 1000 and making it all useless.

$delay = $message->getDeliveryDelay();
if ($delay) {
	[...]
    $dbalMessage['delayed_until'] = time() + (int) $delay / 1000;
}

If you need a delay of 1 day (86400s), you'll only get 1 minute and 26 seconds

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions