mirror of
https://github.com/simon987/sist2.git
synced 2025-12-16 08:49:07 +00:00
Compare commits
4 Commits
3.1.2
...
f984baf7fd
| Author | SHA1 | Date | |
|---|---|---|---|
| f984baf7fd | |||
| ce242d1053 | |||
| 71deab7fa2 | |||
|
|
b0462f9378 |
@@ -187,6 +187,7 @@ class Sist2Index:
|
|||||||
def name(self) -> str:
|
def name(self) -> str:
|
||||||
return self._descriptor["name"]
|
return self._descriptor["name"]
|
||||||
|
|
||||||
|
|
||||||
class WebOptions(BaseModel):
|
class WebOptions(BaseModel):
|
||||||
indices: List[str] = []
|
indices: List[str] = []
|
||||||
|
|
||||||
@@ -212,7 +213,8 @@ class WebOptions(BaseModel):
|
|||||||
f"--lang={self.lang}"]
|
f"--lang={self.lang}"]
|
||||||
|
|
||||||
if search_backend.backend_type == SearchBackendType("sqlite"):
|
if search_backend.backend_type == SearchBackendType("sqlite"):
|
||||||
args.append(f"--search-index={search_backend.search_index}")
|
search_index_absolute = os.path.join(DATA_FOLDER, search_backend.search_index)
|
||||||
|
args.append(f"--search-index={search_index_absolute}")
|
||||||
else:
|
else:
|
||||||
args.append(f"--es-url={search_backend.es_url}")
|
args.append(f"--es-url={search_backend.es_url}")
|
||||||
args.append(f"--es-index={search_backend.es_index}")
|
args.append(f"--es-index={search_backend.es_index}")
|
||||||
@@ -238,6 +240,7 @@ class WebOptions(BaseModel):
|
|||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
class Sist2:
|
class Sist2:
|
||||||
|
|
||||||
def __init__(self, bin_path: str, data_directory: str):
|
def __init__(self, bin_path: str, data_directory: str):
|
||||||
@@ -357,5 +360,3 @@ class Sist2:
|
|||||||
t_stdout.start()
|
t_stdout.start()
|
||||||
|
|
||||||
return proc.pid
|
return proc.pid
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -155,19 +155,17 @@ void parse(parse_job_t *job) {
|
|||||||
doc->meta_head = NULL;
|
doc->meta_head = NULL;
|
||||||
doc->meta_tail = NULL;
|
doc->meta_tail = NULL;
|
||||||
doc->size = job->vfile.st_size;
|
doc->size = job->vfile.st_size;
|
||||||
doc->mtime = job->vfile.mtime;
|
doc->mtime = MAX(job->vfile.mtime, 0);
|
||||||
doc->mime = get_mime(job);
|
doc->mime = get_mime(job);
|
||||||
generate_doc_id(doc->filepath + ScanCtx.index.desc.root_len, doc->doc_id);
|
generate_doc_id(doc->filepath + ScanCtx.index.desc.root_len, doc->doc_id);
|
||||||
|
|
||||||
if (doc->mime == GET_MIME_ERROR_FATAL) {
|
if (doc->mime == GET_MIME_ERROR_FATAL) {
|
||||||
|
|
||||||
CLOSE_FILE(job->vfile)
|
CLOSE_FILE(job->vfile)
|
||||||
free(doc);
|
free(doc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (database_mark_document(ProcData.index_db, doc->doc_id, doc->mtime)) {
|
if (database_mark_document(ProcData.index_db, doc->doc_id, doc->mtime)) {
|
||||||
|
|
||||||
CLOSE_FILE(job->vfile)
|
CLOSE_FILE(job->vfile)
|
||||||
free(doc);
|
free(doc);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user