private void CacheRunningMissions()
        {
            //running missions for active characters
            var queryStr = @"
select 
ml.*
from missionlog ml 
JOIN characters c ON c.characterID=ml.characterID
where ml.finished is NULL and c.active=1";

            try
            {
                var lastOnline    = HostInfo.GetLastOnline();
                var offlinePeriod = DateTime.Now.Subtract(lastOnline);

                Logger.Info("the server was " + offlinePeriod + " offline.");


                var shiftedExpiry =
                    //offset exiry dates
                    Db.Query().CommandText("UPDATE missionlog SET expire=DATEADD(MINUTE,@offlineMinutes , expire ) WHERE finished IS NULL")
                    .SetParameter("@offlineMinutes", (int)offlinePeriod.TotalMinutes)
                    .ExecuteNonQuery();

                Logger.Info(shiftedExpiry + " missions' expiry date got offseted with " + offlinePeriod);


                var missionRecords = Db.Query().CommandText(queryStr).Execute().ToList();

                foreach (var record in missionRecords)
                {
                    var missionId = record.GetValue <int>("missionid");

                    Mission mission;
                    if (!_missionDataCache.GetMissionById(missionId, out mission))
                    {
                        //skip mission load
                        continue;
                    }

                    var missionInProgress = MissionHelper.ReadMissionInProgressByRecord(record, mission);

                    if (missionInProgress == null)
                    {
                        continue;
                    }

                    // add to ram
                    AddMissionInProgress(missionInProgress);
                }

                Logger.Info(_missionInProgress.Count + " running missions cached.");
            }
            catch (Exception ex)
            {
                Logger.Error("error occured in caching the running missions." + ex.Message);
            }
        }