a1b14a4173
MirrorLog entries are not cleaned up by default and will clog the database. The django settings now defines a retention period in days for how long to keep mirror logs, on every mirrorcheck run older logs will be removed from the database.
14 lines
661 B
Python
14 lines
661 B
Python
from mirrors.models import MirrorUrl, MirrorProtocol, Mirror
|
|
|
|
|
|
def create_mirror_url(name='mirror1', country='US',
|
|
protocol='http', url='https://archlinux.org/'):
|
|
mirror = Mirror.objects.create(name=name,
|
|
admin_email='admin@archlinux.org')
|
|
mirror_protocol = MirrorProtocol.objects.create(protocol=protocol)
|
|
mirror_url = MirrorUrl.objects.create(url=url,
|
|
protocol=mirror_protocol,
|
|
mirror=mirror,
|
|
country=country)
|
|
return mirror_url
|