kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
12661b1938
commit
75e9a7ed1a
|
|
@ -24,7 +24,6 @@ from arroba.util import (
|
|||
service_jwt,
|
||||
TOMBSTONED,
|
||||
)
|
||||
import brevity
|
||||
import dag_json
|
||||
from flask import abort, redirect, request
|
||||
from google.cloud import dns
|
||||
|
|
|
|||
|
|
@ -1204,8 +1204,11 @@ class Object(StringIdModel, AddRemoveMixin):
|
|||
They recommend not indexing TTL properties:
|
||||
https://cloud.google.com/datastore/docs/ttl#ttl_properties_and_indexes
|
||||
"""
|
||||
if self.deleted or self.type not in DONT_EXPIRE_OBJECT_TYPES:
|
||||
return (self.updated or util.now()) + OBJECT_EXPIRE_AGE
|
||||
now = self.updated or util.now()
|
||||
if self.deleted:
|
||||
return now + timedelta(days=1)
|
||||
elif self.type not in DONT_EXPIRE_OBJECT_TYPES:
|
||||
return now + OBJECT_EXPIRE_AGE
|
||||
|
||||
expire = ndb.ComputedProperty(_expire, indexed=False)
|
||||
|
||||
|
|
|
|||
|
|
@ -880,7 +880,7 @@ class ObjectTest(TestCase):
|
|||
self.assertIsNone(obj.expire)
|
||||
|
||||
obj.deleted = True
|
||||
self.assertEqual(NOW + OBJECT_EXPIRE_AGE, obj.expire)
|
||||
self.assertEqual(NOW + timedelta(days=1), obj.expire)
|
||||
|
||||
def test_as1_from_as2(self):
|
||||
self.assert_equals({
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue