Ejemplo n.º 1
0
    public async Task MoveSwitch(SwitchId id, Instant time)
    {
        _logger.Information("Updated {SwitchId} timestamp: {SwitchTimestamp}", id, time);
        var query = new Query("switches").AsUpdate(new { timestamp = time }).Where("id", id);
        await _db.ExecuteQuery(query);

        _ = _dispatch.Dispatch(id, new UpdateDispatchData
        {
            Event     = DispatchEvent.UPDATE_SWITCH,
            EventData = JObject.FromObject(new
            {
                timestamp = time.FormatExport(),
            }),
        });
    }