SBarnes wrote:I am getting an issue with a debtor.updated webhook that whilst working and posting instantly is being sent twice, is there any reason this would be happening, this is with Jiwa 7.2.0 SR6?
public ServiceStack.Web.IHttpResult Post(JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem request)
string reqbody = base.Request.GetRawBody();
public WebhookMessagesTimer(int TimerInterval)
{
_timer = new System.Timers.Timer { AutoReset = false, Interval = TimerInterval };
_timer.Elapsed += delegate
{
_timer.Stop();
// List<System.Threading.Tasks.Task> tasks = new List<System.Threading.Tasks.Task>();
// Process the message queue
List<SY_WebhookMessage> messages = RESTAPIPlugin.WebhookMessages.OrderBy(x => x.ItemNo).ToList<SY_WebhookMessage>();
foreach (SY_WebhookMessage message in messages)
{
// System.Threading.Tasks.Task task = System.Threading.Tasks.Task.Factory.StartNew(() => { WebHookController.CallWebhook(message); } );
// tasks.Add(task);
WebHookController.CallWebhook(message);
}
// if (tasks.Count > 0)
// {
// System.Threading.Tasks.Task.WaitAll(tasks.ToArray());
// tasks.Clear();
// }
_timer.Start(); // restart the timer
};
_timer.Start();
}
SELECT dbo.SY_WebhookSubscription.RecID, dbo.SY_WebhookSubscription.SY_WebhookSubscriber_RecID, dbo.SY_WebhookSubscription.EventName, dbo.SY_WebhookSubscription.URL,
dbo.SY_WebhookSubscriber.Name, dbo.SY_WebhookSubscriber.RecID AS SY_WebhookSubscriberRecID
FROM dbo.SY_WebhookSubscription LEFT OUTER JOIN
dbo.SY_WebhookSubscriber ON dbo.SY_WebhookSubscription.SY_WebhookSubscriber_RecID = dbo.SY_WebhookSubscriber.RecID
WHERE (dbo.SY_WebhookSubscriber.RecID IS NULL)
Users browsing this forum: No registered users and 2 guests