mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 08:04:49 +01:00
recorder: add simple recorder config indexing to redis
This commit is contained in:
parent
d38bb5a1fd
commit
aa80cd6881
17
recorder/test/rec.ini
Normal file
17
recorder/test/rec.ini
Normal file
@ -0,0 +1,17 @@
|
||||
[uwsgi]
|
||||
if-not-env = PORT
|
||||
http-socket = :8010
|
||||
endif =
|
||||
|
||||
master = true
|
||||
buffer-size = 65536
|
||||
die-on-term = true
|
||||
|
||||
if-env = VIRTUAL_ENV
|
||||
venv = $(VIRTUAL_ENV)
|
||||
endif =
|
||||
|
||||
gevent = 100
|
||||
#gevent-early-monkey-patch =
|
||||
|
||||
wsgi = recorder.test.simplerec
|
23
recorder/test/simplerec.py
Normal file
23
recorder/test/simplerec.py
Normal file
@ -0,0 +1,23 @@
|
||||
from gevent import monkey; monkey.patch_all()
|
||||
|
||||
from recorder.recorderapp import RecorderApp
|
||||
from recorder.redisindexer import WritableRedisIndexer
|
||||
|
||||
from recorder.warcwriter import MultiFileWARCWriter
|
||||
from recorder.filters import SkipDupePolicy
|
||||
|
||||
upstream_url = 'http://localhost:8080'
|
||||
|
||||
target = './_recordings/'
|
||||
|
||||
dedup_index = WritableRedisIndexer('redis://localhost/2/rec:cdxj',
|
||||
file_key_template='rec:warc',
|
||||
rel_path_template=target,
|
||||
dupe_policy=SkipDupePolicy())
|
||||
|
||||
recorder_app = RecorderApp(upstream_url,
|
||||
MultiFileWARCWriter(target, dedup_index=dedup_index),
|
||||
accept_colls='live')
|
||||
|
||||
application = recorder_app
|
||||
|
Loading…
x
Reference in New Issue
Block a user