mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Use patch in place of put in the indexer API call, ensure that files are not being required in the indexer path
This commit is contained in:
committed by
Debanjum Singh Solanky
parent
ffbf57292c
commit
4a7efdc552
@@ -544,7 +544,7 @@ export default function SettingsView() {
|
||||
const syncContent = async (type: string) => {
|
||||
try {
|
||||
const response = await fetch(`/api/content?t=${type}`, {
|
||||
method: 'PUT',
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
|
||||
@@ -81,7 +81,7 @@ class IndexerInput(BaseModel):
|
||||
@requires(["authenticated"])
|
||||
async def put_content(
|
||||
request: Request,
|
||||
files: list[UploadFile],
|
||||
files: Optional[List[UploadFile]] = [],
|
||||
t: Optional[Union[state.SearchType, str]] = state.SearchType.All,
|
||||
client: Optional[str] = None,
|
||||
user_agent: Optional[str] = Header(None),
|
||||
@@ -103,7 +103,7 @@ async def put_content(
|
||||
@requires(["authenticated"])
|
||||
async def patch_content(
|
||||
request: Request,
|
||||
files: list[UploadFile],
|
||||
files: Optional[List[UploadFile]] = [],
|
||||
t: Optional[Union[state.SearchType, str]] = state.SearchType.All,
|
||||
client: Optional[str] = None,
|
||||
user_agent: Optional[str] = Header(None),
|
||||
|
||||
@@ -988,14 +988,15 @@ class ApiIndexedDataLimiter:
|
||||
self.total_entries_size_limit = total_entries_size_limit
|
||||
self.subscribed_total_entries_size = subscribed_total_entries_size_limit
|
||||
|
||||
def __call__(self, request: Request, files: List[UploadFile]):
|
||||
def __call__(self, request: Request, files: List[UploadFile] = None):
|
||||
if state.billing_enabled is False:
|
||||
return
|
||||
|
||||
subscribed = has_required_scope(request, ["premium"])
|
||||
incoming_data_size_mb = 0.0
|
||||
deletion_file_names = set()
|
||||
|
||||
if not request.user.is_authenticated:
|
||||
if not request.user.is_authenticated or not files:
|
||||
return
|
||||
|
||||
user: KhojUser = request.user.object
|
||||
|
||||
Reference in New Issue
Block a user