Пример #1
0
 public void LogFunctionQueued(FunctionInstanceSnapshot snapshot)
 {
     // Ignore the return result. Only the dashboard calls this method, and it does so before enqueuing the
     // message to the host to run the function. So realistically the blob can't already exist. And even if the
     // host did see the message before this call, an existing blob just means something more recent than
     // "queued" status, so there's nothing to do here in that case anyway.
     _store.TryCreate(GetId(snapshot), snapshot);
 }
Пример #2
0
        private bool TryUpdateEntity(string functionId, Action <FunctionStatistics> modifier)
        {
            IConcurrentDocument <FunctionStatistics> result = _store.Read(functionId);

            if (result == null || result.Document == null)
            {
                FunctionStatistics statistics = new FunctionStatistics();
                modifier.Invoke(statistics);
                return(_store.TryCreate(functionId, statistics));
            }
            else
            {
                FunctionStatistics statistics = result.Document;
                modifier.Invoke(statistics);
                return(_store.TryUpdate(functionId, result.ETag, statistics));
            }
        }