Skip to content

Commit

Permalink
[PSL-1217] (#904)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateeullahmalik authored Jul 16, 2024
1 parent 7af2b54 commit 671aa6f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 36 deletions.
26 changes: 0 additions & 26 deletions p2p/kademlia/store/sqlite/replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,6 @@ func (n *nodeReplicationInfo) toDomain() domain.NodeReplicationInfo {
}
}

/*
type repKeys struct {
Key string `db:"key"`
UpdatedAt time.Time `db:"updatedAt"`
IP string `db:"ip"`
Port int `db:"port"`
ID string `db:"id"`
Attempts int `db:"attempts"`
}
func (r repKeys) toDomain() (domain.ToRepKey, error) {
key, err := hex.DecodeString(r.Key)
if err != nil {
return domain.ToRepKey{}, fmt.Errorf("error decoding key: %w", err)
}
return domain.ToRepKey{
Key: key,
UpdatedAt: r.UpdatedAt,
IP: r.IP,
Port: r.Port,
ID: r.ID,
Attempts: r.Attempts,
}, nil
}*/

func (s *Store) migrateReplication() error {
replicateQuery := `
CREATE TABLE IF NOT EXISTS replication_info(
Expand Down
2 changes: 1 addition & 1 deletion supernode/services/common/storage_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
const (
loadSymbolsBatchSize = 2500
storeSymbolsPercent = 10
concurrency = 2
concurrency = 1
)

// StorageHandler provides common logic for RQ and P2P operations
Expand Down
16 changes: 8 additions & 8 deletions walletnode/api/services/cascade.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,16 @@ func (service *CascadeAPIHandler) getTxIDs(ctx context.Context, txID string) (tx
}

return
}
} else {
filename, size, err := service.download.GetFilenameAndSize(ctx, txID)
if err != nil {
return nil, ticket
}
} else {
filename, size, err := service.download.GetFilenameAndSize(ctx, txID)
if err != nil {
return nil, ticket
}

ticket.NameOfOriginalFile = filename
ticket.SizeOfOriginalFileMB = utils.BytesIntToMB(size)
ticket.NameOfOriginalFile = filename
ticket.SizeOfOriginalFileMB = utils.BytesIntToMB(size)

}
}
txIDs = append(txIDs, txID)

Expand Down
2 changes: 1 addition & 1 deletion walletnode/node/grpc/download_nft.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (service *downloadNft) Download(ctx context.Context, txid, timestamp, signa
}
file = append(file, resp.File...)
if utils.BytesIntToMB(len(file)) > init+10 {
log.WithContext(ctx).WithField("total-recieved", utils.BytesIntToMB(len(file))).Info("received 10 MB file chunk")
log.WithContext(ctx).WithField("total-recieved", utils.BytesIntToMB(len(file))).Debug("received 10 MB file chunk")
init = init + 10
}
}
Expand Down

0 comments on commit 671aa6f

Please sign in to comment.