mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-17 13:24:50 -07:00
(minor) fix invalid PG gc query example
This commit is contained in:
2
dist/example_config.yaml
vendored
2
dist/example_config.yaml
vendored
@@ -234,7 +234,7 @@ mochi:
|
||||
# query for check if database is alive
|
||||
#ping_query: SELECT 1
|
||||
# query for garbage collection, expected parameter is timestamp
|
||||
#gc_query: DELETE FROM mo_peers WHERE created > $1
|
||||
#gc_query: DELETE FROM mo_peers WHERE created <= $1
|
||||
# The amount of time until a peer is considered stale.
|
||||
# To avoid churn, keep this slightly larger than `announce_interval`
|
||||
#peer_lifetime: 31m
|
||||
|
||||
@@ -140,7 +140,7 @@ storage:
|
||||
# Query for check if database is alive (can be omitted)
|
||||
ping_query: SELECT 1
|
||||
# Query to delete stale peers (peers, which timestamp older than provided argument)
|
||||
gc_query: DELETE FROM mo_peers WHERE created > $1
|
||||
gc_query: DELETE FROM mo_peers WHERE created <= $1
|
||||
# The frequency which stale peers are removed.
|
||||
gc_interval: 3m
|
||||
# Query to get all info hash count (used for statistics).
|
||||
|
||||
@@ -59,7 +59,7 @@ var cfg = Config{
|
||||
GetQuery: "SELECT value FROM mo_kv WHERE context=$1 AND name=$2",
|
||||
DelQuery: "DELETE FROM mo_kv WHERE context=$1 AND name=$2",
|
||||
},
|
||||
GCQuery: "DELETE FROM mo_peers WHERE created > $1",
|
||||
GCQuery: "DELETE FROM mo_peers WHERE created <= $1",
|
||||
InfoHashCountQuery: "SELECT COUNT(DISTINCT info_hash) as info_hashes FROM mo_peers",
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user