Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make the singleton 'tools' a pointer
  • Loading branch information
cmaglie committed Mar 20, 2024
commit c2b4096ea617877b479c0c6669b40cd4f8dfb1c6
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func uploadHandler(c *gin.Context) {

go func() {
// Resolve commandline
commandline, err := upload.PartiallyResolve(data.Board, filePath, tmpdir, data.Commandline, data.Extra, &Tools)
commandline, err := upload.PartiallyResolve(data.Board, filePath, tmpdir, data.Commandline, data.Extra, Tools)
if err != nil {
send(map[string]string{uploadStatusStr: "Error", "Msg": err.Error()})
return
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ var homeTemplateHTML string

// global clients
var (
Tools tools.Tools
Tools *tools.Tools
Systray systray.Systray
Index *index.Resource
)
Expand Down Expand Up @@ -252,7 +252,7 @@ func loop() {

// Instantiate Index and Tools
Index = index.Init(*indexURL, config.GetDataDir())
Tools = *tools.New(config.GetDataDir(), Index, logger)
Tools = tools.New(config.GetDataDir(), Index, logger)

// see if we are supposed to wait 5 seconds
if *isLaunchSelf {
Expand Down