Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-system-updater
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-system-updater
Commits
1f6fe85e
Commit
1f6fe85e
authored
Mar 27, 2026
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refresh repos before checking updates
parent
08e4bea4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
8 deletions
+39
-8
system.go
backend/eepm/system.go
+35
-0
main.go
main.go
+0
-7
scheduler_service.go
service/scheduler_service.go
+0
-1
update_service.go
service/update_service.go
+4
-0
No files found.
backend/eepm/system.go
View file @
1f6fe85e
...
@@ -11,6 +11,41 @@ import (
...
@@ -11,6 +11,41 @@ import (
"github.com/diamondburned/gotk4/pkg/glib/v2"
"github.com/diamondburned/gotk4/pkg/glib/v2"
)
)
func
(
c
*
Client
)
RefreshRepos
(
ctx
context
.
Context
,
transaction
string
)
error
{
errorCh
:=
make
(
chan
error
,
1
)
args
:=
glib
.
NewVariantTuple
([]
*
glib
.
Variant
{
glib
.
NewVariantString
(
transaction
),
})
c
.
conn
.
QueryProxy
.
Call
(
ctx
,
"Update"
,
args
,
gio
.
DBusCallFlagsNone
,
300000
,
// 5 minutes timeout
func
(
res
gio
.
AsyncResulter
)
{
_
,
err
:=
c
.
conn
.
QueryProxy
.
CallFinish
(
res
)
if
err
!=
nil
{
errorCh
<-
err
return
}
errorCh
<-
nil
},
)
select
{
case
<-
ctx
.
Done
()
:
return
ctx
.
Err
()
case
err
:=
<-
errorCh
:
if
err
!=
nil
{
log
.
Printf
(
"RefreshRepos error: %v"
,
err
)
return
fmt
.
Errorf
(
"repo refresh failed: %w"
,
err
)
}
return
nil
}
}
func
(
c
*
Client
)
CheckSystemUpdates
(
ctx
context
.
Context
)
(
*
model
.
PackageChanges
,
error
)
{
func
(
c
*
Client
)
CheckSystemUpdates
(
ctx
context
.
Context
)
(
*
model
.
PackageChanges
,
error
)
{
resultCh
:=
make
(
chan
*
glib
.
Variant
,
1
)
resultCh
:=
make
(
chan
*
glib
.
Variant
,
1
)
errorCh
:=
make
(
chan
error
,
1
)
errorCh
:=
make
(
chan
error
,
1
)
...
...
main.go
View file @
1f6fe85e
...
@@ -7,7 +7,6 @@ import (
...
@@ -7,7 +7,6 @@ import (
"SystemUpdater/service"
"SystemUpdater/service"
"SystemUpdater/store"
"SystemUpdater/store"
"SystemUpdater/ui"
"SystemUpdater/ui"
"context"
"log"
"log"
"os"
"os"
...
@@ -67,12 +66,6 @@ func main() {
...
@@ -67,12 +66,6 @@ func main() {
app
.
ConnectActivate
(
func
()
{
app
.
ConnectActivate
(
func
()
{
window
:=
ui
.
NewWindow
(
app
,
st
,
updateSvc
,
historySvc
)
window
:=
ui
.
NewWindow
(
app
,
st
,
updateSvc
,
historySvc
)
window
.
Window
.
Present
()
window
.
Window
.
Present
()
go
func
()
{
if
err
:=
updateSvc
.
CheckAllUpdates
(
context
.
Background
());
err
!=
nil
{
log
.
Printf
(
"Initial update check failed: %v"
,
err
)
}
}()
})
})
app
.
ConnectCommandLine
(
func
(
cmdLine
*
gio
.
ApplicationCommandLine
)
int
{
app
.
ConnectCommandLine
(
func
(
cmdLine
*
gio
.
ApplicationCommandLine
)
int
{
...
...
service/scheduler_service.go
View file @
1f6fe85e
...
@@ -56,7 +56,6 @@ func (ss *SchedulerService) Stop() {
...
@@ -56,7 +56,6 @@ func (ss *SchedulerService) Stop() {
}
}
func
(
ss
*
SchedulerService
)
run
()
{
func
(
ss
*
SchedulerService
)
run
()
{
// Run immediately on start
ss
.
checkUpdates
()
ss
.
checkUpdates
()
for
{
for
{
...
...
service/update_service.go
View file @
1f6fe85e
...
@@ -30,6 +30,10 @@ func (us *UpdateService) CheckAllUpdates(ctx context.Context) error {
...
@@ -30,6 +30,10 @@ func (us *UpdateService) CheckAllUpdates(ctx context.Context) error {
us
.
store
.
Dispatch
(
&
store
.
SetPhaseAction
{
Phase
:
store
.
PhaseLoading
})
us
.
store
.
Dispatch
(
&
store
.
SetPhaseAction
{
Phase
:
store
.
PhaseLoading
})
if
err
:=
us
.
eepmClient
.
RefreshRepos
(
ctx
,
""
);
err
!=
nil
{
log
.
Printf
(
"Failed to refresh repos: %v"
,
err
)
}
err
:=
us
.
doCheckAllUpdates
(
ctx
)
err
:=
us
.
doCheckAllUpdates
(
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
// Try reconnect and retry once
// Try reconnect and retry once
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment