Skip to content
Snippets Groups Projects
Commit cda49dbf authored by Travis Ralston's avatar Travis Ralston
Browse files

Remove useless 1023 check in snowflake

parent 31774d58
No related branches found
No related tags found
No related merge requests found
package ids
import (
"errors"
"os"
"strconv"
"github.com/bwmarrin/snowflake"
"github.com/turt2live/matrix-media-repo/common/config"
)
func GetMachineId() int64 {
if val, ok := os.LookupEnv("MACHINE_ID"); ok {
if i, err := strconv.ParseInt(val, 10, 64); err == nil {
if i == 1023 && !config.Runtime.IsImportProcess {
panic(errors.New("machine ID 1023 is reserved for use by import process"))
}
return i
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment