diff options
author | 2022-11-22 19:38:10 +0100 | |
---|---|---|
committer | 2022-11-22 18:38:10 +0000 | |
commit | 50dc179d332af4a3dc0e69e2c4e39bbbccd3fec5 (patch) | |
tree | b48421907353aa6530a76f8c345e3bc11aeab4c9 /internal/id/ulid.go | |
parent | [docs] Document http/s/socks5 proxy use (#1118) (diff) | |
download | gotosocial-50dc179d332af4a3dc0e69e2c4e39bbbccd3fec5.tar.xz |
[feature] Prune timelines once per hour to plug memory leak (#1117)
* export highest/lowest ULIDs as proper const
* add stop + start to timeline manager, other small fixes
* unexport unused interface funcs + tidy up
* add LastGot func
* add timeline Prune function
* test prune
* update lastGot
Diffstat (limited to 'internal/id/ulid.go')
-rw-r--r-- | internal/id/ulid.go | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/internal/id/ulid.go b/internal/id/ulid.go index 1b0c2e537..d61d7fcec 100644 --- a/internal/id/ulid.go +++ b/internal/id/ulid.go @@ -1,3 +1,21 @@ +/* + GoToSocial + Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + package id import ( @@ -8,7 +26,11 @@ import ( "github.com/oklog/ulid" ) -const randomRange = 631152381 // ~20 years in seconds +const ( + Highest = "ZZZZZZZZZZZZZZZZZZZZZZZZZZ" // Highest is the highest possible ULID + Lowest = "00000000000000000000000000" // Lowest is the lowest possible ULID + randomRange = 631152381 // ~20 years in seconds +) // ULID represents a Universally Unique Lexicographically Sortable Identifier of 26 characters. See https://github.com/oklog/ulid type ULID string |