mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 10:53:02 +01: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:
parent
ffbf57292c
commit
4a7efdc552
3 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue