Skip to content

Commit

Permalink
Disable gicache code. JIRA: OMDM-127
Browse files Browse the repository at this point in the history
git-svn-id: https://anonsvn.ncbi.nlm.nih.gov/repos/v1/trunk/c++@103398 78c7ea69-d796-4a43-9a09-de51944f1b03
  • Loading branch information
venco5 authored and gouriano committed Nov 7, 2024
1 parent 091b508 commit e5b7b35
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/objtools/data_loaders/genbank/gicache/reader_gicache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@
#include <corelib/plugin_manager_impl.hpp>
#include <corelib/plugin_manager_store.hpp>

#include "gicache.h"
//#define USE_GICACHE

#ifdef USE_GICACHE
# include "gicache.h"
#else
# define DEFAULT_GI_CACHE_PATH ""
#endif

#define NCBI_USE_ERRCODE_X Objtools_Rd_GICache

Expand Down Expand Up @@ -75,11 +80,14 @@ CGICacheReader::CGICacheReader(const TPluginManagerParamTree* params,

CGICacheReader::~CGICacheReader()
{
#ifdef USE_GICACHE
CMutexGuard guard(m_Mutex);
GICache_ReadEnd();
#endif
}


#ifdef USE_GICACHE
static
void s_LogFunc(int severity, char* msg)
{
Expand All @@ -102,11 +110,13 @@ void s_LogFunc(int severity, char* msg)
};
ERR_POST(Severity(sev[min(size_t(severity), ArraySize(sev)-1)]) << msg);
}
#endif


void CGICacheReader::x_Initialize(void)
{
ERR_POST_ONCE("This app is using deprecated OM++ reader gicache. Please remove it from your configuration.");
#ifdef USE_GICACHE
string index = m_Path;
if ( CFile(index).IsDir() ) {
const char* file;
Expand All @@ -120,6 +130,7 @@ void CGICacheReader::x_Initialize(void)
CMutexGuard guard(m_Mutex);
GICache_SetLogEx(s_LogFunc);
GICache_ReadData(index.c_str());
#endif
}


Expand Down Expand Up @@ -166,6 +177,7 @@ bool CGICacheReader::LoadSeq_idAccVer(CReaderRequestResult& result,
{
if ( seq_id.IsGi() ) {
CLoadLockAcc ids(result, seq_id);
#ifdef USE_GICACHE
char buffer[256];
int got;
{{
Expand All @@ -187,6 +199,7 @@ bool CGICacheReader::LoadSeq_idAccVer(CReaderRequestResult& result,
}
}
}
#endif
}
// if any problem occurs -> fall back to regular reader
return false;
Expand Down

0 comments on commit e5b7b35

Please sign in to comment.