Fix deletion script
This commit is contained in:
parent
57de076fec
commit
6b16a768a7
|
@ -1,6 +1,8 @@
|
||||||
import database
|
import database
|
||||||
import search
|
import search
|
||||||
import sys
|
import sys
|
||||||
|
import settings
|
||||||
|
import logging
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import requests
|
import requests
|
||||||
|
@ -21,7 +23,7 @@ def database_del_story(sid):
|
||||||
|
|
||||||
def search_del_story(sid):
|
def search_del_story(sid):
|
||||||
try:
|
try:
|
||||||
r = requests.delete(search.MEILI_URL + 'indexes/qotnews/documents/'+sid, timeout=2)
|
r = requests.delete(settings.MEILI_URL + 'indexes/qotnews/documents/'+sid, timeout=2)
|
||||||
if r.status_code != 202:
|
if r.status_code != 202:
|
||||||
raise Exception('Bad response code ' + str(r.status_code))
|
raise Exception('Bad response code ' + str(r.status_code))
|
||||||
return r.json()
|
return r.json()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user