示例#1
0
        internal EPICardDetail AddOrUpdateCardInDetail(int installationNo, string cardNo)
        {
            using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "AddOrUpdateTimeout"))
            {
                EPICardDetail result = null;

                try
                {
                    (result = this.GetCardInDetail(installationNo)).CardNo = cardNo;
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }

                return(result);
            }
        }
示例#2
0
        public void CheckEPITimeouts(int installationNo)
        {
            using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "CheckEPITimeouts"))
            {
                try
                {
                    EPITimeout timeout = this.GetTimeout(installationNo, EPIProcessType.IntervalRating);
                    if (timeout == null)
                    {
                        return;
                    }

                    if ((timeout.LastUpdatedTime.AddMinutes(_configStore.EPICardInMeterUpdate) - DateTime.Now).Seconds >= 0)
                    {
                        method.Info("Running EPI Interval Rating");

                        //  This happens due to two threads are executing this method at the same time.
                        if ((Interlocked.Read(ref timeout.IsInProcess) == 1))
                        {
                            method.Info("Some other thread is already generating the Interval Rating, So i am skipping now.");
                            return;
                        }
                        //  I am executing now
                        if ((Interlocked.CompareExchange(ref timeout.IsInProcess, 1, 0) == 1))
                        {
                            method.Info("Some other thread has already taken control, So i am skipping now.");
                            return;
                        }

                        EPICardDetail cardDetail = this.GetCardInDetail(installationNo);
                        SDTMessages.Instance.ProcessPlayerCardSessionRatings(installationNo);
                        timeout.LastUpdatedTime = DateTime.Now;
                        Interlocked.Exchange(ref timeout.IsInProcess, 0);
                    }
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }
            }
        }
示例#3
0
 internal void ClearCardDetails(EPICardDetail cardDetail)
 {
     _playerCardInDetails.Update(cardDetail.CardNo, 0);
     cardDetail.Clear();
 }