Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
notifications-bot
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
archives
notifications-bot
Commits
e85c5ca9
Commit
e85c5ca9
authored
Jan 18, 2022
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Basic local testing
parent
a8438d13
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!32
Release
,
!26
M203/auto recover
,
!25
Restructure notification code for batching
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
storage/databaseImpl.go
+1
-1
1 addition, 1 deletion
storage/databaseImpl.go
storage/mapImpl_test.go
+7
-0
7 additions, 0 deletions
storage/mapImpl_test.go
with
8 additions
and
1 deletion
storage/databaseImpl.go
+
1
−
1
View file @
e85c5ca9
...
...
@@ -70,7 +70,7 @@ func (d *DatabaseImpl) GetAllUsers() ([]*User, error) {
func
(
d
*
DatabaseImpl
)
GetOrphanedUsers
()
([]
*
User
,
error
)
{
var
dest
[]
*
User
return
dest
,
d
.
db
.
Find
(
dest
,
"NOT EXISTS (select * from ephemerals where ephemerals.transmission_rsa_hash = users.transmission_rsa_hash)"
)
.
Error
return
dest
,
d
.
db
.
Find
(
&
dest
,
"NOT EXISTS (select * from ephemerals where ephemerals.transmission_rsa_hash = users.transmission_rsa_hash)"
)
.
Error
}
func
(
d
*
DatabaseImpl
)
insertEphemeral
(
ephemeral
*
Ephemeral
)
error
{
...
...
This diff is collapsed.
Click to expand it.
storage/mapImpl_test.go
+
7
−
0
View file @
e85c5ca9
...
...
@@ -65,6 +65,13 @@ func TestDatabaseImpl(t *testing.T) {
if
err
!=
nil
{
t
.
Errorf
(
"Failed to upsert updated user: %+v"
,
err
)
}
orphaned
,
err
:=
s
.
GetOrphanedUsers
()
if
err
!=
nil
{
t
.
Errorf
(
"Failed to get orphaned users: %+v"
,
err
)
}
if
len
(
orphaned
)
<
1
{
t
.
Errorf
(
"Should have found orphaned users, instead found %+v"
,
orphaned
)
}
_
,
err
=
s
.
AddLatestEphemeral
(
u2
,
5
,
16
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to add latest ephemeral: %+v"
,
err
)
...
...
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