- m_db->Execute("UPDATE tblLocalIdentity SET InsertingIdentity='false', LastInsertedIdentity='"+now.Format("%Y-%m-%d %H:%M:%S")+"' WHERE LocalIdentityID="+idparts[1]+";");\r
- m_db->Execute("INSERT INTO tblLocalIdentityInserts(LocalIdentityID,Day,InsertIndex) VALUES("+idparts[1]+",'"+idparts[4]+"',"+idparts[2]+");");\r
- m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,"IdentityInserter::HandleMessage inserted Identity xml");\r
+ \r
+ // do check to make sure this is the non-editioned SSK - we ignore failure/success for editioned SSK for now\r
+ if(message["Identifier"].find(".xml")!=std::string::npos)\r
+ {\r
+ // a little hack here - if we just inserted index yesterday and it is now the next day - we would have inserted todays date not yesterdays as LastInsertedIdentity.\r
+ // If this is the case, we will skip updating LastInsertedIdentity so that we can insert this identity again for today\r
+ Poco::DateTime lastdate;\r
+ int tzdiff=0;\r
+ Poco::DateTimeParser::tryParse("%Y-%m-%d",idparts[4],lastdate,tzdiff);\r
+ if(lastdate.day()==now.day())\r
+ {\r
+ m_db->Execute("UPDATE tblLocalIdentity SET InsertingIdentity='false', LastInsertedIdentity='"+Poco::DateTimeFormatter::format(now,"%Y-%m-%d %H:%M:%S")+"' WHERE LocalIdentityID="+idparts[1]+";");\r
+ }\r
+ else\r
+ {\r
+ m_db->Execute("UPDATE tblLocalIdentity SET InsertingIdentity='false' WHERE LocalIdentityID="+idparts[1]+";");\r
+ }\r
+ m_db->Execute("INSERT INTO tblLocalIdentityInserts(LocalIdentityID,Day,InsertIndex) VALUES("+idparts[1]+",'"+idparts[4]+"',"+idparts[2]+");");\r
+ m_log->debug("IdentityInserter::HandleMessage inserted Identity xml");\r
+ }\r
+ else\r
+ {\r
+ m_log->trace("IdentityInserter::HandleMessage inserted editioned Identity xml");\r
+ }\r