feat: site languages, setup and site URL settings
This commit is contained in:
1 parent
0806733d5c
commit
d9158025d4
106 files changed
+10184
-56
No files matched your search
@@ -23,6 +23,7 @@ type Config struct {
|
||||
type Driver interface {
|
||||
Open(source string) (*gorm.DB, error)
|
||||
NewBackup(db *gorm.DB, directory string, now func() time.Time) domainUpdate.DatabaseBackup
|
||||
IsLockContention(err error) bool
|
||||
}
|
||||
|
||||
var drivers = map[string]Driver{
|
||||
@@ -31,6 +32,15 @@ var drivers = map[string]Driver{
|
||||
DriverPostgres: postgresDriver{},
|
||||
}
|
||||
|
||||
func IsLockContentionFor(driverName string, err error) bool {
|
||||
driver, ok := drivers[driverName]
|
||||
return ok && err != nil && driver.IsLockContention(err)
|
||||
}
|
||||
|
||||
func IsLockContention(db *gorm.DB, err error) bool {
|
||||
return IsLockContentionFor(db.Name(), err)
|
||||
}
|
||||
|
||||
type Connection struct {
|
||||
DB *gorm.DB
|
||||
driver Driver
|
||||
|
||||
Reference in new issue
Block a user