Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
c0a279e8
Commit
c0a279e8
authored
9 years ago
by
Mark Haines
Browse files
Options
Downloads
Patches
Plain Diff
Delete the table objects from TransactionStore
parent
96e400fe
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
synapse/storage/transactions.py
+10
-58
10 additions, 58 deletions
synapse/storage/transactions.py
tests/handlers/test_presence.py
+0
-1
0 additions, 1 deletion
tests/handlers/test_presence.py
tests/handlers/test_typing.py
+0
-1
0 additions, 1 deletion
tests/handlers/test_typing.py
with
10 additions
and
60 deletions
synapse/storage/transactions.py
+
10
−
58
View file @
c0a279e8
...
@@ -16,8 +16,6 @@
...
@@ -16,8 +16,6 @@
from
._base
import
SQLBaseStore
from
._base
import
SQLBaseStore
from
synapse.util.caches.descriptors
import
cached
from
synapse.util.caches.descriptors
import
cached
from
collections
import
namedtuple
from
canonicaljson
import
encode_canonical_json
from
canonicaljson
import
encode_canonical_json
import
logging
import
logging
...
@@ -50,12 +48,15 @@ class TransactionStore(SQLBaseStore):
...
@@ -50,12 +48,15 @@ class TransactionStore(SQLBaseStore):
def
_get_received_txn_response
(
self
,
txn
,
transaction_id
,
origin
):
def
_get_received_txn_response
(
self
,
txn
,
transaction_id
,
origin
):
result
=
self
.
_simple_select_one_txn
(
result
=
self
.
_simple_select_one_txn
(
txn
,
txn
,
table
=
R
eceived
T
ransactions
Table
.
table_name
,
table
=
"
r
eceived
_t
ransactions
"
,
keyvalues
=
{
keyvalues
=
{
"
transaction_id
"
:
transaction_id
,
"
transaction_id
"
:
transaction_id
,
"
origin
"
:
origin
,
"
origin
"
:
origin
,
},
},
retcols
=
ReceivedTransactionsTable
.
fields
,
retcols
=
(
"
transaction_id
"
,
"
origin
"
,
"
ts
"
,
"
response_code
"
,
"
response_json
"
,
"
has_been_referenced
"
,
),
allow_none
=
True
,
allow_none
=
True
,
)
)
...
@@ -79,7 +80,7 @@ class TransactionStore(SQLBaseStore):
...
@@ -79,7 +80,7 @@ class TransactionStore(SQLBaseStore):
"""
"""
return
self
.
_simple_insert
(
return
self
.
_simple_insert
(
table
=
R
eceived
T
ransactions
Table
.
table_name
,
table
=
"
r
eceived
_t
ransactions
"
,
values
=
{
values
=
{
"
transaction_id
"
:
transaction_id
,
"
transaction_id
"
:
transaction_id
,
"
origin
"
:
origin
,
"
origin
"
:
origin
,
...
@@ -136,7 +137,7 @@ class TransactionStore(SQLBaseStore):
...
@@ -136,7 +137,7 @@ class TransactionStore(SQLBaseStore):
self
.
_simple_insert_txn
(
self
.
_simple_insert_txn
(
txn
,
txn
,
table
=
S
ent
T
ransactions
.
table_name
,
table
=
"
s
ent
_t
ransactions
"
,
values
=
{
values
=
{
"
id
"
:
next_id
,
"
id
"
:
next_id
,
"
transaction_id
"
:
transaction_id
,
"
transaction_id
"
:
transaction_id
,
...
@@ -171,7 +172,7 @@ class TransactionStore(SQLBaseStore):
...
@@ -171,7 +172,7 @@ class TransactionStore(SQLBaseStore):
code
,
response_json
):
code
,
response_json
):
self
.
_simple_update_one_txn
(
self
.
_simple_update_one_txn
(
txn
,
txn
,
table
=
S
ent
T
ransactions
.
table_name
,
table
=
"
s
ent
_t
ransactions
"
,
keyvalues
=
{
keyvalues
=
{
"
transaction_id
"
:
transaction_id
,
"
transaction_id
"
:
transaction_id
,
"
destination
"
:
destination
,
"
destination
"
:
destination
,
...
@@ -229,11 +230,11 @@ class TransactionStore(SQLBaseStore):
...
@@ -229,11 +230,11 @@ class TransactionStore(SQLBaseStore):
def
_get_destination_retry_timings
(
self
,
txn
,
destination
):
def
_get_destination_retry_timings
(
self
,
txn
,
destination
):
result
=
self
.
_simple_select_one_txn
(
result
=
self
.
_simple_select_one_txn
(
txn
,
txn
,
table
=
D
estinations
Table
.
table_name
,
table
=
"
d
estinations
"
,
keyvalues
=
{
keyvalues
=
{
"
destination
"
:
destination
,
"
destination
"
:
destination
,
},
},
retcols
=
D
estination
sTable
.
fields
,
retcols
=
(
"
d
estination
"
,
"
retry_last_ts
"
,
"
retry_interval
"
)
,
allow_none
=
True
,
allow_none
=
True
,
)
)
...
@@ -304,52 +305,3 @@ class TransactionStore(SQLBaseStore):
...
@@ -304,52 +305,3 @@ class TransactionStore(SQLBaseStore):
txn
.
execute
(
query
,
(
self
.
_clock
.
time_msec
(),))
txn
.
execute
(
query
,
(
self
.
_clock
.
time_msec
(),))
return
self
.
cursor_to_dict
(
txn
)
return
self
.
cursor_to_dict
(
txn
)
class
ReceivedTransactionsTable
(
object
):
table_name
=
"
received_transactions
"
fields
=
[
"
transaction_id
"
,
"
origin
"
,
"
ts
"
,
"
response_code
"
,
"
response_json
"
,
"
has_been_referenced
"
,
]
class
SentTransactions
(
object
):
table_name
=
"
sent_transactions
"
fields
=
[
"
id
"
,
"
transaction_id
"
,
"
destination
"
,
"
ts
"
,
"
response_code
"
,
"
response_json
"
,
]
EntryType
=
namedtuple
(
"
SentTransactionsEntry
"
,
fields
)
class
TransactionsToPduTable
(
object
):
table_name
=
"
transaction_id_to_pdu
"
fields
=
[
"
transaction_id
"
,
"
destination
"
,
"
pdu_id
"
,
"
pdu_origin
"
,
]
class
DestinationsTable
(
object
):
table_name
=
"
destinations
"
fields
=
[
"
destination
"
,
"
retry_last_ts
"
,
"
retry_interval
"
,
]
This diff is collapsed.
Click to expand it.
tests/handlers/test_presence.py
+
0
−
1
View file @
c0a279e8
...
@@ -28,7 +28,6 @@ from synapse.api.constants import PresenceState
...
@@ -28,7 +28,6 @@ from synapse.api.constants import PresenceState
from
synapse.api.errors
import
SynapseError
from
synapse.api.errors
import
SynapseError
from
synapse.handlers.presence
import
PresenceHandler
,
UserPresenceCache
from
synapse.handlers.presence
import
PresenceHandler
,
UserPresenceCache
from
synapse.streams.config
import
SourcePaginationConfig
from
synapse.streams.config
import
SourcePaginationConfig
from
synapse.storage.transactions
import
DestinationsTable
from
synapse.types
import
UserID
from
synapse.types
import
UserID
OFFLINE
=
PresenceState
.
OFFLINE
OFFLINE
=
PresenceState
.
OFFLINE
...
...
This diff is collapsed.
Click to expand it.
tests/handlers/test_typing.py
+
0
−
1
View file @
c0a279e8
...
@@ -27,7 +27,6 @@ from ..utils import (
...
@@ -27,7 +27,6 @@ from ..utils import (
from
synapse.api.errors
import
AuthError
from
synapse.api.errors
import
AuthError
from
synapse.handlers.typing
import
TypingNotificationHandler
from
synapse.handlers.typing
import
TypingNotificationHandler
from
synapse.storage.transactions
import
DestinationsTable
from
synapse.types
import
UserID
from
synapse.types
import
UserID
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment