mirror of
https://github.com/simon987/sist2.git
synced 2025-12-14 07:49:06 +00:00
use sqlite to save index, major thread pool refactor
This commit is contained in:
27
src/ctx.h
27
src/ctx.h
@@ -16,22 +16,17 @@
|
||||
#include "libscan/msdoc/msdoc.h"
|
||||
#include "libscan/wpd/wpd.h"
|
||||
#include "libscan/json/json.h"
|
||||
#include "src/io/store.h"
|
||||
#include "src/database/database.h"
|
||||
#include "src/index/elastic.h"
|
||||
#include "sqlite3.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <pcre.h>
|
||||
|
||||
typedef struct {
|
||||
struct index_t index;
|
||||
|
||||
GHashTable *mime_table;
|
||||
GHashTable *ext_table;
|
||||
|
||||
tpool_t *pool;
|
||||
|
||||
tpool_t *writer_pool;
|
||||
|
||||
int threads;
|
||||
int depth;
|
||||
int calculate_checksums;
|
||||
@@ -39,16 +34,10 @@ typedef struct {
|
||||
size_t stat_tn_size;
|
||||
size_t stat_index_size;
|
||||
|
||||
GHashTable *original_table;
|
||||
GHashTable *copy_table;
|
||||
GHashTable *new_table;
|
||||
pthread_mutex_t copy_table_mu;
|
||||
|
||||
pcre *exclude;
|
||||
pcre_extra *exclude_extra;
|
||||
int fast;
|
||||
|
||||
GHashTable *dbg_current_files;
|
||||
pthread_mutex_t dbg_current_files_mu;
|
||||
|
||||
int dbg_failed_files_count;
|
||||
@@ -84,10 +73,6 @@ typedef struct {
|
||||
char *es_index;
|
||||
int batch_size;
|
||||
tpool_t *pool;
|
||||
store_t *tag_store;
|
||||
GHashTable *tags;
|
||||
store_t *meta_store;
|
||||
GHashTable *meta;
|
||||
/**
|
||||
* Set to false when using --print
|
||||
*/
|
||||
@@ -117,10 +102,18 @@ typedef struct {
|
||||
int dev;
|
||||
} WebCtx_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int thread_id;
|
||||
database_t *ipc_db;
|
||||
database_t *index_db;
|
||||
} ProcData_t;
|
||||
|
||||
extern ScanCtx_t ScanCtx;
|
||||
extern WebCtx_t WebCtx;
|
||||
extern IndexCtx_t IndexCtx;
|
||||
extern LogCtx_t LogCtx;
|
||||
extern __thread ProcData_t ProcData;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user