Fix meilisearch auth
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import database
|
||||
import search
|
||||
import sys
|
||||
import settings
|
||||
import logging
|
||||
|
||||
import json
|
||||
import requests
|
||||
@@ -22,16 +20,8 @@ def database_del_story(sid):
|
||||
session.close()
|
||||
|
||||
def search_del_story(sid):
|
||||
try:
|
||||
r = requests.delete(settings.MEILI_URL + 'indexes/qotnews/documents/'+sid, timeout=2)
|
||||
if r.status_code != 202:
|
||||
raise Exception('Bad response code ' + str(r.status_code))
|
||||
return r.json()
|
||||
except KeyboardInterrupt:
|
||||
raise
|
||||
except BaseException as e:
|
||||
logging.error('Problem deleting MeiliSearch story: {}'.format(str(e)))
|
||||
return False
|
||||
return search.meili_api(
|
||||
requests.delete, 'indexes/qotnews/documents/' + sid)
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) == 2:
|
||||
|
||||
Reference in New Issue
Block a user